execStoredProcedure()

Executes an SQL stored procedure in the relationship database by specifying its name and parameter array.

Syntax

void execStoredProcedure(String storedProcedure, 
    Vector storedProcParameters)
 

Parameters

storedProcedure
The name of the SQL stored procedure to run in the relationship database.

storedProcParameters
A Vector object of parameters to pass to the stored procedure. Each parameter is an instance of the UserStoredProcedureParam class. For more information on how to pass parameters through this array, see

Return values

None.

Exceptions

DtpConnectionException - If a database error occurs.

Notes

Before executing a stored procedure with execStoredProcedure(), you must create a DtpConnection object with the getRelConnection() method from the BaseDLM class.

You can also use the executeSQL() method to execute a stored procedure as long as this stored procedure does not contain OUT parameters. If the stored procedure uses OUT parameters, you must use execStoredProcedure() to execute it. Unlike with executeSQL(), you do not have to pass in the full SQL statement to execute the stored procedure. With execStoredProcedure(), you need to pass in only the name of the stored procedure and a Vector parameter array of UserStoredProcedureParam objects. The execStoredProcedure() method can determine the number of parameters from the storedProcParameters array and builds the calling statement for the stored procedure.

See also

executeSQL(), getRelConnection(), hasMoreRows(), nextRow()

Copyright IBM Corp. 1997, 2003