1.1

Table Of Contents
Chapter 26
Using the Procedure Provider API
SQLFire provides an API to help you develop data-aware procedures. A ProcedureExecutionContext object provides
information about the table used to lter the procedure execution, colocated data, and other information about the
context in which a procedure is executed. An OutgoingResultSet interface enables you to construct a result set by
adding rows or columns to a List object.
Use the information in this section to develop and compile your procedure, and then add the implementation to SQLFire
using the instructions in Storing and Loading JAR Files in SQLFire on page 121. You can then congure and execute
the procedure using the information in Using Data-Aware Stored Procedures on page 153.
Procedure Parameters
When you congure a procedure using the CREATE PROCEDURE statement, SQLFire assembles the method
parameters and passes them to the procedure implementation class using Java reection.
The different types of parameters are handled in the following ways:
IN and INOUT parameters are passed to the procedure implementation as single-element arrays.
DYNAMIC RESULT SETS specied in the CREATE PROCEDURE statement cause additional method
arguments to be appended, one for each dynamic result set. Each argument is treated as a ResultSet[] type.
SQLFire passes in each argument as a single-element array containing a null value.
For example, if you specify DYNAMIC RESULT SETS 2, SQLFire appends two additional ResultSet[]
arguments, each with a single null value.
ResultSets are returned to the application through the CallableStatement, in the order that they are dened in
the procedure body. See Populating Result Sets on page 160.
The procedure implementation class can optionally specify a ProcedureExecutionContext parameter as the last
parameter. SQLFire then passes in the procedure context object, which the implementation can use to determine
information about the execution context.
Note: The CREATE PROCEDURE and CALL statements should not reference the procedure context
object as a procedure parameter.
For example, if the Java method signature of the procedure implementation is:
package com.acme.MyProc;
import java.sql.*;
public class MyProc
{public static void myMethod(String inParam1,
Integer[] outParam2,
Date[] inoutParam3,
159