| org.apache.derby.iapi.sql.conn.StatementContext
All known Subclasses: org.apache.derby.impl.sql.conn.GenericStatementContext,
StatementContext | public interface StatementContext extends Context(Code) | | StatementContext keeps the context for a statement.
|
Method Summary | |
public void | addDependency(Dependency dy) Track a Dependency within this StatementContext. | public void | cancel() Indicate that the statement which has allocated this statement
context should cancel its execution. | public void | clearInUse() Mark this context as not in use. | public void | clearSavePoint() Clear the save point for the current statement. | public short | getSQLAllowed() Get the setting of the SQL allowed state. | public String | getStatementText() Return the text of the current statement.
Note that this may be null. | public NoPutResultSet[] | getSubqueryTrackingArray() Get the subquery tracking array for this query. | public boolean | getSystemCode() Return true if this statement is system code. | public boolean | inTrigger() Returns whether we started from within the context of a trigger
or not. | public boolean | inUse() Is this statement context in use or not. | public boolean | isAtomic() Indicates whether the statement needs to be executed atomically
or not, i.e., whether a commit/rollback is permitted by a
connection nested in this statement. | public boolean | isCancelled() Checks if the statement which has allocated this statement context
should cancel its execution. | public boolean | isForReadOnly() | public boolean | onStack() Reports whether this StatementContext is on the context stack.
true if this StatementContext is on the context stack. | public void | resetSavePoint() If this statement context has a savepoint, then
it is reset to the current point. | public void | setInUse(boolean inTrigger, boolean isAtomic, boolean isForReadOnly, String stmtText, ParameterValueSet pvs, long timeoutMillis) Mark this context as being in use.
Parameters: inTrigger - true if the parent started in the context of a trigger Parameters: isAtomic - true if the statement must be executedatomically Parameters: isForReadOnly - true if the statement is for producing non-updatableresultset Parameters: stmtText - the text of the statement. | public void | setParentRollback() Indicate that, in the event of a statement-level exception,
this context is NOT the last one that needs to be rolled
back--rather, it is nested within some other statement
context, and that other context needs to be rolled back,
too. | public void | setSQLAllowed(short allow, boolean force) Set the level of SQL allowed in this and subsequent
nested statements due to a routine call. | public void | setSavePoint() Set a save point for the current statement. | public void | setSubqueryResultSet(int subqueryNumber, NoPutResultSet subqueryResultSet, int numSubqueries) Set the appropriate entry in the subquery tracking array for
the specified subquery. | public void | setSystemCode() Set to indicate statement is system code. | public void | setTopResultSet(ResultSet topResultSet, NoPutResultSet[] subqueryTrackingArray) Set the top ResultSet in the ResultSet tree for close down on
an error. |
addDependency | public void addDependency(Dependency dy) throws StandardException(Code) | | Track a Dependency within this StatementContext.
(We need to clear any dependencies added within this
context on an error.
Parameters: dy - The dependency to track. exception: StandardException - Thrown on error |
cancel | public void cancel()(Code) | | Indicate that the statement which has allocated this statement
context should cancel its execution.
Usually called as a consequence of Statement.cancel() or a query timeout
set with Statement.setQueryTimeout().
|
clearInUse | public void clearInUse()(Code) | | Mark this context as not in use. This is important because we
always leave the top statement context on the stack, and we don't
want to clean it up if a statement level exception happens while the
context is not in use.
|
getSQLAllowed | public short getSQLAllowed()(Code) | | Get the setting of the SQL allowed state.
|
getStatementText | public String getStatementText()(Code) | | Return the text of the current statement.
Note that this may be null. It is currently
not set up correctly for ResultSets that aren't
single row result sets (e.g SELECT)
and setXXXX/getXXXX jdbc methods.
the statement text |
getSubqueryTrackingArray | public NoPutResultSet[] getSubqueryTrackingArray() throws StandardException(Code) | | Get the subquery tracking array for this query.
(Useful for runtime statistics.)
NoPutResultSet[] The (sparse) array of tops of subquery ResultSet trees exception: StandardException - Thrown on error |
getSystemCode | public boolean getSystemCode()(Code) | | Return true if this statement is system code.
|
inTrigger | public boolean inTrigger()(Code) | | Returns whether we started from within the context of a trigger
or not.
true if we are in a trigger context |
inUse | public boolean inUse()(Code) | | Is this statement context in use or not.
true if in use |
isAtomic | public boolean isAtomic()(Code) | | Indicates whether the statement needs to be executed atomically
or not, i.e., whether a commit/rollback is permitted by a
connection nested in this statement.
true if needs to be atomic |
isCancelled | public boolean isCancelled()(Code) | | Checks if the statement which has allocated this statement context
should cancel its execution.
true if the statement execution should be cancelled. |
isForReadOnly | public boolean isForReadOnly()(Code) | | Is this statement for a read only, non-updatable ResultSet
true if the statement is for creating a read only, non-updatable ResultSet |
onStack | public boolean onStack()(Code) | | Reports whether this StatementContext is on the context stack.
true if this StatementContext is on the context stack. false otherwise. |
resetSavePoint | public void resetSavePoint() throws StandardException(Code) | | If this statement context has a savepoint, then
it is reset to the current point. Otherwise, it
is a noop.
exception: StandardException - Thrown on error |
setInUse | public void setInUse(boolean inTrigger, boolean isAtomic, boolean isForReadOnly, String stmtText, ParameterValueSet pvs, long timeoutMillis)(Code) | | Mark this context as being in use.
Parameters: inTrigger - true if the parent started in the context of a trigger Parameters: isAtomic - true if the statement must be executedatomically Parameters: isForReadOnly - true if the statement is for producing non-updatableresultset Parameters: stmtText - the text of the statement. Needed for any languagestatement (currently, for any statement that can cause a triggerto fire). Please set this unless you are some funky jdbc setXXXmethod or something. Parameters: pvs - parameter value set, if it has one Parameters: timeoutMillis - timeout value for the statement, in milliseconds.Zero means no timeout. |
setParentRollback | public void setParentRollback()(Code) | | Indicate that, in the event of a statement-level exception,
this context is NOT the last one that needs to be rolled
back--rather, it is nested within some other statement
context, and that other context needs to be rolled back,
too.
|
setSQLAllowed | public void setSQLAllowed(short allow, boolean force)(Code) | | Set the level of SQL allowed in this and subsequent
nested statements due to a routine call. Value must be one of
RoutineAliasInfo.{MODIFIES_SQL_DATA, READS_SQL_DATA, CONTAINS_SQL, NO_SQL}
Parameters: force - set to true to override more restrictive setting. Used toreset the permissions after a function call. |
setSavePoint | public void setSavePoint() throws StandardException(Code) | | Set a save point for the current statement.
NOTE: This needs to be off of the StatementContext so that it gets
cleared on a statement error.
exception: StandardException - Thrown on error |
setSubqueryResultSet | public void setSubqueryResultSet(int subqueryNumber, NoPutResultSet subqueryResultSet, int numSubqueries) throws StandardException(Code) | | Set the appropriate entry in the subquery tracking array for
the specified subquery.
Useful for closing down open subqueries on an exception.
Parameters: subqueryNumber - The subquery # for this subquery Parameters: subqueryResultSet - The NoPutResultSet at the top of the subquery Parameters: numSubqueries - The total # of subqueries in the entire query exception: StandardException - Thrown on error |
setSystemCode | public void setSystemCode()(Code) | | Set to indicate statement is system code.
For example a system procedure, view, function etc.
|
setTopResultSet | public void setTopResultSet(ResultSet topResultSet, NoPutResultSet[] subqueryTrackingArray) throws StandardException(Code) | | Set the top ResultSet in the ResultSet tree for close down on
an error.
Parameters: topResultSet - The top ResultSet in the ResultSet tree Parameters: subqueryTrackingArray - (Sparse) of tops of subquery ResultSet trees exception: StandardException - Thrown on error |
|
|