my dog learned polymorphism
The moose likes JDBC and Relational Databases and the fly likes calling Stored Procedure in DB2 thru JDBC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "calling Stored Procedure in DB2 thru JDBC" Watch "calling Stored Procedure in DB2 thru JDBC" New topic

calling Stored Procedure in DB2 thru JDBC

Deepika Wadhwa
Ranch Hand

Joined: Aug 05, 2000
Posts: 57
What is better approach for executing the stored procedure if we use either Prepared Statement or Callable statement ?

Is there any performance difference ???

Thanks in advance
VS Prapoorna

Joined: Oct 13, 2001
Posts: 22
Use a PreparedStatement when you execute the same statement more than once.
Use CallableStatement to execute stored procedures. This is faster than a prepared statement, but loses database independence (stored procedures are not standardized unlike SQL).
I think this explanation might helpful.
Sarada Prapoorna.V
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

Your name does not comply with the JavaRanch naming standard described at
I also notice that you have changed your name from a valid name to this invalid name. Please change it back, since your account will be locked otherwise.
I agree. Here's the link:
subject: calling Stored Procedure in DB2 thru JDBC
It's not a secret anymore!