aspose file tools*
The moose likes JDBC and the fly likes Prepared Statement Vs. Callable Statement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
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: 8908
    
    8

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: 30537
    
150

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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Prepared Statement Vs. Callable Statement