HP Driver for JDBC User's Manual

Chapter 5 51
ALLBASE/SQL Specifics
Stored Procedures
Stored Procedures
The HP Driver for JDBC supports the following types of
ALLBASE/SQL stored procedures through the
java.sql.CallableStatement interface:
1. Procedures that return one or more result sets.
2. Procedures that take one or more input arguments.
3. Procedures that return one or more output arguments.
4. Procedures that have a return status value.
Procedures may be of one or more of these combinations; for example,
the procedure may have parameterized input and a return status, and
return one or more result sets.
Stored procedures are executed by first creating a
java.sql.CallableStatement object with the execute procedure SQL
statement. The execute procedure SQL statement in one or more of the
following formats (each format corresponds to one of the cases listed
above):
1. EXECUTE PROCEDURE PROCNAME
2. EXECUTE PROCEDURE PROCNAME(10, ?)
3. EXECUTE PROCEDURE PROCNAME(? OUTPUT, ? OUTPUT ONLY)
4. EXECUTE PROCEDURE ? = PROCNAME
Input arguments can be either explicitly specified in the SQL
statement, or dynamic parameters can be used for passing values when
the statement is executed.
Output only arguments must be specified with a dynamic parameter,
otherwise the output value will not be returned.