aspose file tools
The moose likes JDBC and the fly likes Prepared Statement Vs. Callable Statement Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "Prepared Statement Vs. Callable Statement" Watch "Prepared Statement Vs. Callable Statement" New topic
Author

Prepared Statement Vs. Callable Statement

Amit M Singh
Greenhorn

Joined: Mar 23, 2004
Posts: 2
When should the two be used?
I understand that callable statement is used for procedures but apart from that what are the advantages of callable statement over prepared statement.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8291

CallableStatement
is the interface used to execute SQL stored procedures
[ March 23, 2004: Message edited by: Joe Ess ]

"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 26499
    
  78

Amit,
The real question is what are the advantages of stored procedures vs prepared statements. The main one is that stored procedures are faster because run completely on the database while prepared statements are more portable.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Amit M Singh
Greenhorn

Joined: Mar 23, 2004
Posts: 2
Thanks a lot you guys.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Prepared Statement Vs. Callable Statement
 
Similar Threads
Prepared Vs Callable statements
not able to get values into database
Rangarajan Balasubramanian
what is better
PreparedStatement's executeQuery() returning resultset with no rows