File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Prepared Vs Callable statements Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Reply locked New topic
Author

Prepared Vs Callable statements

vishnu mohan
Greenhorn

Joined: Feb 01, 2002
Posts: 14
hi,
what is the difference between prepared statement and the callable statements ?
Thanks and regards
Vishnu
Snigdha Solanki
Ranch Hand

Joined: Sep 07, 2000
Posts: 128
Prepared Statement is used to execute SQL query whereas Callbale Statement is used to execute Stored Procedures.


Snigdha<br />Sun Certified Programmer for the Java™ 2 Platform
Alex Sanchez
Greenhorn

Joined: Mar 21, 2002
Posts: 4
That's right, and a stored procedure is , as written in the MySQL manual:
A stored procedure is a set of SQL commands that can be compiled and stored in the server. Once this has been done, clients don't need to keep re-issuing the entire query but can refer to the stored procedure. This provides better performance because the query has to be parsed only once, and less information needs to be sent between the server and the client. You can also raise the conceptual level by having libraries of functions in the server.
angela irfani
Greenhorn

Joined: Mar 31, 2010
Posts: 1
Hi all!

What if I use Callable statements to execute SQL query, is it okay?
Is prepared statement better than callable statements to execute SQL query?

Thanks for the info..
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2476
    
    7

Hi Angela,

Welcome to JavaRanch!

Can you create a new thread. This one is from 2002.
Please also do a search in the JDBC forum. We have had several posts on the same subject this week.

Regards, Jan


OCUP UML fundamental and ITIL foundation
youtube channel
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Prepared Vs Callable statements
 
Similar Threads
Stored Procedure Problem
1 Lakh( Hundred Thousand ) lines of data into database.
calling a PL/SQL procedure from a Java application
what is better
Comparing two Dates