The JDBC call escape sequence is the same as in ODBC. For example:

                { 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.

Table 1. JDBC stored procedure code
try
{     CallableStatement statement;
     int Part_num = 318;
     
     // Associate the statement with the procedure call
     // (conn is a previously-instantiated connection object)
     statement = conn.prepareCall("{call order_parts(?)}");
     
     // Bind the parameter.
     statement.setInt(1, Part_num);
     
     // Execute the statement.
     statement.execute();
}