Top Description Fields Constructors Methods
org.apache.derby.impl.sql.execute

pack-priv Class CallStatementResultSet

extends NoRowsResultSetImpl
Class Inheritance
Imports
java.sql.ResultSet, .SQLException, org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.jdbc.ConnectionContext, org.apache.derby.iapi.services.loader.GeneratedMethod, org.apache.derby.iapi.sql.Activation, org.apache.derby.iapi.sql.conn.LanguageConnectionContext

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

Modifier and TypeField and Description
private final GeneratedMethod
Inherited from org.apache.derby.impl.sql.execute.NoRowsResultSetImpl:
activationbeginExecutionTimebeginTimeendExecutionTimeendTimelcc

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
cleanUp()

Implements org.apache.derby.iapi.sql.ResultSet.cleanUp.

Tells the system to clean up on an error.

public void
close()

Implements org.apache.derby.iapi.sql.ResultSet.close.

Need to explicitly close any dynamic result sets.

public void
open()

Implements org.apache.derby.iapi.sql.ResultSet.open.

Just invoke the method.

Inherited from org.apache.derby.impl.sql.execute.NoRowsResultSetImpl:
addWarningcheckRowPositionclearCurrentRowclosedoesCommitevaluateGenerationClausesfinishgetAbsoluteRowgetActivationgetAutoGeneratedKeysResultsetgetBeginExecutionTimestampgetCurrentTimeMillisgetCursorNamegetEndExecutionTimestampgetExecuteTimegetFirstRowgetLastRowgetNextRowgetPreviousRowgetQueryPlanTextgetRelativeRowgetResultDescriptiongetRowNumbergetSubqueryTrackingArraygetTimeSpentgetWarningsisClosedmodifiedRowCountreturnsRowssetAfterLastRowsetBeforeFirstRowsetuptoXML

Field Detail

methodCallback to summary
private final GeneratedMethod methodCall

Constructor Detail

CallStatementResultSetback to summary
pack-priv CallStatementResultSet(GeneratedMethod methodCall, Activation a)

Method Detail

cleanUpback to summary
public void cleanUp() throws StandardException

Implements org.apache.derby.iapi.sql.ResultSet.cleanUp.

Doc from org.apache.derby.iapi.sql.ResultSet.cleanUp.

Tells the system to clean up on an error.

Exceptions
StandardException:
Thrown on error.
See Also
org.apache.derby.iapi.sql.ResultSet#cleanUp
closeback to summary
public void close() throws StandardException

Implements org.apache.derby.iapi.sql.ResultSet.close.

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.

Exceptions
StandardException:

Doc from org.apache.derby.iapi.sql.ResultSet.close.

Thrown on error.

openback to summary
public void open() throws StandardException

Implements org.apache.derby.iapi.sql.ResultSet.open.

Just invoke the method.

Exceptions
StandardException:
Standard Derby error policy