Using Stored Procedures

For a secure, consistent, and manageable multi-tier client/server system, the data access should allow the use of stored procedures. Stored procedures centralize the business logic in terms of manageability and running the query. Java applets or applications running on clients with limited resources cannot be expected to run huge queries. JDBC allows the use of stored procedures by way of the CallableStatement class.

A CallableStatement object is created by the prepareCall method in the Connection object. The prepareCall method takes a string as the parameter. This string, called an escape clause, is of the form

{ [? =] call <stored procedure name> [<parameter>,<parameter> ...]}

The CallableStatement class supports parameters. ...

Get Special Edition Using Java 2 Standard Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.