Java Stored Procedures

You can write DB2 Java stored procedures in both JDBC and in SQLj, although we recommend the latter for better performance. There are also two ways to pass parameters to stored procedures, which you declare when cataloging your stored procedure with a CREATE PROCEDURE statement. The PARAMETER STYLE DB2GENERAL requires you to extend a class called COM.ibm.db2.app.StoredProc, and pass IN, IN/OUT, and OUT arguments in the specified order. One of the drawbacks to this method is that it is more proprietary, and also requires you to instantiate a separate class of the stored procedure with every invocation.

DB2 UDB V6.1 introduced Java stored procedures that use the SQLJ Routines standard, which are cataloged using PARAMETER ...

Get DB2® Universal Database™ v8 Application Development Certification Guide, 2nd 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.