Tuesday, 29 March 2016

How to call a stored procedure in JDBC ?



Callable statements are used from JDBC application to invoke stored procedures and functions.

PL/SQL stored procedures are called from within JDBC programs by means of the prepareCall() method of the Connection object created.

A call to this method takes variable bind parameters as input parameters as well as output variables and creates an object instance of the CallableStatement class.

Example
CallableStatement callableStmt = 
         conn.prepareCall("{call procname(?,?,?)}");

No comments:

Post a Comment

Note: only a member of this blog may post a comment.