WebSphere Adapter for JDBC

Execute operation

The Execute operation is used to run stored procedures. The enterprise service discovery wizard generates the required stored procedure business object that corresponds to the stored procedure definition in the database. The adapter uses the Execute operation to process the stored procedure business object.

The following information provides a simple example of a stored procedure, the business object that is constructed from it, and the steps the adapter uses to process the stored procedure business object with an Execute operation.

A simple example of a stored procedure:
PROCEDURE testSP(IN int x,INOUT VARCHAR(10) msgSTR, OUT int
status, OUT struct outrec, OUT array retArr)
(Procedure returns two resultsets)
For this stored procedure, an example of the business object that is constructed:
BOLevel ASI
      SPName=testSP
      ResultSet=true
      MaxNumberOfResultSets=2
      ReturnValue = propName (if function). Will be property name 
corresponding to the child business object if returned value is complex type
                           (array/struct/resultset) Defined only if it is a Function

Properties
      x Type=IP
      msgStr Type=IO
      status Type=OP
      outrec Type OP - Child BO for outrec, ASI ChildBOType = struct
      retarr Type OP - n cardinality child BO for retArr, ASI ChildBOType = array
      childBOName1 - Child BO for 1st resultset, ASI ChildBOType = resultset
      childBOName2 - Child BO for 2nd resultset, ASI ChildBOType = resultset
To process this stored procedure business object with an Execute operation, the adapter:
  1. Constructs the stored procedure call CALL testSP(x, msgStr, status, outrec)
  2. Sets the input parameters on the callable statement.
  3. Executes the callable statement.
  4. Obtains the return value (if Function) and sets the value in the appropriate attribute if it is a scalar value, or in a child business object if it is a complex value (such as struct, array).
  5. Obtains the first resultset and creates the container for ResultSet1.
  6. Obtains the second resultset and creates the container for ResultSet2.
  7. Obtains out parameters msgStr and status, and sets the corresponding attributes on the business object.
  8. Obtains out parameter outrec and creates the child business object from the data returned in outrec. If outrec is a nested struct type, then the adapter recursively creates and stores data in the hierarchical child business object.
  9. Obtains the out parameter retArr and creates an n cardinality child business object from the data returned in retArr. If retArr is a nested array type, then the adapter recursively creates and stores data in the hierarchical child business object.
Related concepts
Create operation
Retrieve operation
RetrieveAll operation
Update operation
DeltaUpdate operation
Delete operation
ApplyChanges operation

Terms of use |

Last updated: Tue 12 Dec 2006 03:32:38

(c) Copyright IBM Corporation 2005, 2006.
This information center is powered by Eclipse technology (http://www.eclipse.org)