wood burning stoves 2.0*
The moose likes JDBC and the fly likes Access Stored Procedures in MSSQL and MySQL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Access Stored Procedures in MSSQL and MySQL" Watch "Access Stored Procedures in MSSQL and MySQL" New topic
Author

Access Stored Procedures in MSSQL and MySQL

Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 746
Hi, I'm sorry if this is a little vampiric... Please tell me how to access MSSQL or MySQL and MySQL stored procedures using JDBC. Thanks a lot guys!


SCJP 1.5
http://devpinoy.org/blogs/lamia/ - http://everypesocounts.com/
Maximilian Xavier Stocker
Ranch Hand

Joined: Sep 20, 2005
Posts: 381
vampiric?!?

Anyway CallableStatement is what you want. So instead of the Connection.prepareStatement method your code was using you would use Connection.prepareCall instead.

Look at http://java.sun.com/docs/books/tutorial/jdbc/basics/storedprocedures.html and consult the documentation for your database/driver for more information.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Access Stored Procedures in MSSQL and MySQL