All Packages This Package Previous Next
java.lang.Object | +----sqlj.runtime.profile.ref.ProfileWrapper | +----sqlj.runtime.profile.ref.DynamicProfileWrapper | +----sqlj.runtime.profile.ref.PositionedProfile
Entries with role of POSITIONED have a sql operation that includes the text WHERE CURRENT OF ?. For example, UPDATE TAB SET COL1=? WHERE CURRENT OF ?. The JDBC specification indicates that portable handling of CURRENT OF statements involves passing the name of the current-of-cursor as part of the sql operation rather than as a bind variable. Thus, in the above case, if the cursor name were "CURS", then the text of the new operation created at runtime would be UPDATE TAB SET COL1=? WHERE CURRENT OF CURS. To facilitate construction of the proper sql operation, the entry descriptor for POSITIONED entries is an Integer that describes which passed parameter represents the cursor.
If the operation also includes bind variables, these are stored in an internal cache until the new statement is created, and are then bound to the statement once it has been prepared. We assume that POSITIONED entries only occur with an executeType of EXECUTE_UPDATE and statementType of PREPARED_STATEMENT.
public PositionedProfile(DynamicProfile profile)
public RTStatement getStatement(int ndx) throws SQLException
prepareStatement
method of the
underlying dynamic profile. If the role is POSITIONED, the object
returned is a statement that, when executed, dynamically prepares and
executes a new statement with the text of the original statement, but
the dynamic name of the cursor substituted in place of the '?'. All
bound inputs are cached and transferred to the newly created statement
before execution.
It is assumed that POSITIONED statements are always handled with PREPARED statements via the executeUpdate method. If the entry info describes otherwise, this method will raise an exception.
All Packages This Package Previous Next