Using StoredProceduresBlox

StoredProceduresBlox is the starting point for using relational database stored procedures. It allows you to create a connection to a database and prepare a stored procedure statement. Once the correct IBM® Alphablox data source and any other connection parameters are set, you can:

The StoredProcedure object and the MetaData object are separate classes in the com.alphablox.blox.data.rdb.storedprocedure package. By having separate objects for StoredProcedure and MetaData from StoredProceduresBlox, you can prepare a stored procedure once and then execute it multiple times. Even though stored procedure parameters can be altered between executions, you can enhance the performance by not preparing the stored procedures at every execution.

The following diagram shows the object hierarchy of stored procedure related objects.

Because the StoredProcedure and MetaData objects are in a separate package, you must use the following JSP import statement at the beginning of any JSP file to use any of the APIs in these objects:

<%@ page import="com.alphablox.blox.data.rdb.storedprocedure.*" %>
Note: JDBC Stored procedures are supported for IBM DB2®, Sybase, Oracle, and Microsoft® SQL Server databases.
Note the following when using the StoredProcedure object to execute a prepared stored procedure:

Once the stored procedure is executed, it returns a StoredProcedure.ResultSet object, which gives you access to the JDBC ResultSet object. If you need to use the JDBC ResultSet object directly, use the ResultSet.getResultSet() method to get to this object.

It is recommended that you also import the java.sql package when working with stored procedures, so your JSP files should import two packages:

<%@ page import="com.alphablox.blox.data.rdb.storedprocedure.*" %>
<%@ page import="java.sql.*" %>