November 2006
Intermediate to advanced
224 pages
3h 29m
English
CallableStatment cs = conn.prepareCall("{ call ListAllUsers }"); ResultSet rs = cs.executeQuery( ); |
Stored procedures are database programs that are stored and maintained within the database itself. You can call one of these stored procedures from within Java using the CallableStatement interface and the prepareCall() method of the Connection object. A CallableStatement returns a ResultSet object just as a Statement or PreparedStatement does. In this phrase, we call the stored procedure ListAllUsers with no parameters.
A CallableStatement object can take input parameters also. Input parameters are handled exactly as they are when using a Prepared Statement. For example, here we show how you might call a stored procedure ...
Read now
Unlock full access