Calling Stored Procedures from JDBCThe JDBC call escape sequence is the same as in ODBC: { call proc_name [ ( parameter [ , … ] ) ] }
Embed the escape sequence in a JDBC CallableStatement.prepareCall() method invocation. The following example shows the JDBC code parallel to the ODBC code excerpt shown in the previous example. Invoking a Stored Procedure from a JDBC Application
CallableStatement statement; int Part_num = 318;
// (conn is a previously-instantiated connection object) statement = conn.prepareCall("{call order_parts(?)}");
statement.setInt(1, Part_num);
statement.execute(); } |
|||