Class CallStatementResultSet
- java.lang.Object
-
- org.apache.derby.impl.sql.execute.NoRowsResultSetImpl
-
- org.apache.derby.impl.sql.execute.CallStatementResultSet
-
- All Implemented Interfaces:
ResultSet
class CallStatementResultSet extends NoRowsResultSetImpl
Call a Java procedure. This calls a generated method in the activation which sets up the parameters and then calls the Java method that the procedure resolved to.Valid dynamic results returned by the procedure will be closed as inaccessible when this is closed (e.g. a CALL within a trigger).
Any code that requires the dynamic results to be accessible (such as the JDBC Statement object executing the CALL) must obtain the dynamic results from Activation.getDynamicResults() and remove each ResultSet it will be handling by clearing the reference in the object returned.- See Also:
Activation.getDynamicResults()
-
-
Field Summary
Fields Modifier and Type Field Description private GeneratedMethod
methodCall
-
Fields inherited from class org.apache.derby.impl.sql.execute.NoRowsResultSetImpl
activation, beginExecutionTime, beginTime, endExecutionTime, endTime, lcc
-
Fields inherited from interface org.apache.derby.iapi.sql.ResultSet
CURRENT_RESULTSET_ONLY, ENTIRE_RESULTSET_TREE, ISAFTERLAST, ISBEFOREFIRST, ISFIRST, ISLAST
-
-
Constructor Summary
Constructors Constructor Description CallStatementResultSet(GeneratedMethod methodCall, Activation a)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cleanUp()
Tells the system to clean up on an error.void
close()
Need to explicitly close any dynamic result sets.void
open()
Just invoke the method.-
Methods inherited from class org.apache.derby.impl.sql.execute.NoRowsResultSetImpl
addWarning, checkRowPosition, clearCurrentRow, close, doesCommit, evaluateGenerationClauses, finish, getAbsoluteRow, getActivation, getAutoGeneratedKeysResultset, getBeginExecutionTimestamp, getCurrentTimeMillis, getCursorName, getEndExecutionTimestamp, getExecuteTime, getFirstRow, getLastRow, getNextRow, getPreviousRow, getQueryPlanText, getRelativeRow, getResultDescription, getRowNumber, getSubqueryTrackingArray, getTimeSpent, getWarnings, isClosed, modifiedRowCount, returnsRows, setAfterLastRow, setBeforeFirstRow, setup, toXML
-
-
-
-
Field Detail
-
methodCall
private final GeneratedMethod methodCall
-
-
Constructor Detail
-
CallStatementResultSet
CallStatementResultSet(GeneratedMethod methodCall, Activation a)
-
-
Method Detail
-
open
public void open() throws StandardException
Just invoke the method.- Throws:
StandardException
- Standard Derby error policy
-
close
public void close() throws StandardException
Need to explicitly close any dynamic result sets.
If the dynamic results are not accessible then they need to be destroyed (ie. closed) according the the SQL Standard.
An execution of a CALL statement through JDBC makes the dynamic results accessible, in this case the closing of the dynamic result sets is handled by the JDBC statement object (EmbedStatement) that executed the CALL. We cannot unify the closing of dynamic result sets to this close, as in accessible case it is called during the Statement.execute call, thus it would close the dynamic results before the application has a change to use them.
With an execution of a CALL statement as a trigger's action statement the dynamic result sets are not accessible. In this case this close method is called after the execution of the trigger's action statement.
Section 4.27.5 of the TECHNICAL CORRIGENDUM 1 to the SQL 2003 Standard details what happens to dynamic result sets in detail, the SQL 2003 foundation document is missing these details.- Throws:
StandardException
- Thrown on error.
-
cleanUp
public void cleanUp() throws StandardException
Description copied from interface:ResultSet
Tells the system to clean up on an error.- Throws:
StandardException
- Thrown on error.- See Also:
ResultSet.cleanUp()
-
-