DBA > Job Interview Questions > Java database interview questions

How do you call a Stored Procedure from JDBC?

More DBA job interview questions and answers at http://dba.fyicenter.com/Interview-Questions/

1. How do you call a Stored Procedure from JDBC?

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();

(Continued on next question...)

Other Job Interview Questions