Java Database Connectivity Question:
How do you call a Stored Procedure from JDBC?

Answer:
The first step is to create a CallableStatement object. As with Statement and PreparedStatement objects, this is done with an open Connection object. A CallableStatement object contains a call to a stored procedure.
CallableStatement cs =
con.prepareCall("{call SHOW_SUPPLIERS}");
ResultSet rs = cs.executeQuery();
CallableStatement cs =
con.prepareCall("{call SHOW_SUPPLIERS}");
ResultSet rs = cs.executeQuery();
Previous Question | Next Question |
How do you get Column names only for a table (SQL Server)? | Is the JDBC-ODBC Bridge multi-threaded? |