Interface ExecPreparedStatement
-
- All Superinterfaces:
Dependable
,Dependent
,PreparedStatement
- All Known Subinterfaces:
StorablePreparedStatement
- All Known Implementing Classes:
GenericPreparedStatement
,GenericStorablePreparedStatement
public interface ExecPreparedStatement extends PreparedStatement
Execution extends prepared statement to add methods it needs for execution purposes (that should not be on the Database API).
-
-
Field Summary
-
Fields inherited from interface org.apache.derby.catalog.Dependable
ACTIVATION, ALIAS, COLUMNS_IN_TABLE, COLUMNS_PERMISSION, CONGLOMERATE, CONSTRAINT, DEFAULT, FILE, HEAP, INDEX, PERM, PREPARED_STATEMENT, ROLE_GRANT, ROUTINE_PERMISSION, SCHEMA, SEQUENCE, STORED_PREPARED_STATEMENT, TABLE, TABLE_PERMISSION, TRIGGER, VIEW
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
finish(LanguageConnectionContext lcc)
Mark the statement as unusable, i.e. the system is finished with it and no one should be able to use it.GeneratedClass
getActivationClass()
Get the class generated for this prepared statement.ExecPreparedStatement
getClone()
Get a new prepared statement that is a shallow copy of the current one.ConstantAction
getConstantAction()
Get the Execution constants.java.lang.Object
getCursorInfo()
Get the saved cursor info.long
getInitialRowCount(int rsNum, long currentRowCount)
Get the initial row count of the specified result set.java.util.List<StatementPermission>
getRequiredPermissionsList()
java.lang.Object
getSavedObject(int objectNum)
Get a saved object by number.java.util.List<java.lang.Object>
getSavedObjects()
Get all the saved objects.int
getStalePlanCheckInterval()
Get the stale plan check interval.ExecCursorTableReference
getTargetTable()
the target table of the cursorint
getUpdateMode()
the update mode of the cursorboolean
hasUpdateColumns()
Check if this prepared statement has a cursor with columns that can be updated.int
incrementExecutionCount()
Increment and return the execution count for this statement.boolean
isUpdateColumn(java.lang.String columnName)
Check if the specified column name is one of the update columns.boolean
needsSavepoint()
Does this statement need a savpointvoid
setSource(java.lang.String txt)
set the statement textvoid
setSPSAction()
Indicate that the statement represents an SPS actionvoid
setStalePlanCheckInterval(int interval)
Set the stale plan check interval.void
setValid()
set this prepared statement to be validboolean
upToDate(GeneratedClass gc)
Checks whether this PreparedStatement is up to date and its activation class is identical to the supplied generated class.-
Methods inherited from interface org.apache.derby.catalog.Dependable
getClassType, getDependableFinder, getObjectID, getObjectName, isPersistent
-
Methods inherited from interface org.apache.derby.iapi.sql.depend.Dependent
isValid, makeInvalid, prepareToInvalidate
-
Methods inherited from interface org.apache.derby.iapi.sql.PreparedStatement
execute, executeSubStatement, executeSubStatement, getActivation, getBeginCompileTimestamp, getBindTimeInMillis, getCompileTimeInMillis, getCompileTimeWarnings, getEndCompileTimestamp, getGenerateTimeInMillis, getOptimizeTimeInMillis, getParameterType, getParameterTypes, getParseTimeInMillis, getResultDescription, getSource, getSPSName, getVersionCounter, isAtomic, referencesSessionSchema, rePrepare, upToDate
-
-
-
-
Method Detail
-
setSource
void setSource(java.lang.String txt)
set the statement text- Parameters:
txt
- the source text
-
getConstantAction
ConstantAction getConstantAction()
Get the Execution constants. This routine is called at Execution time.- Returns:
- ConstantAction The big structure enclosing the Execution constants.
-
getSavedObject
java.lang.Object getSavedObject(int objectNum)
Get a saved object by number. This is called during execution to access objects created at compile time. These are meant to be read-only at run time.- Returns:
- Object A saved object. The caller has to know what it is requesting and cast it back to the expected type.
-
getSavedObjects
java.util.List<java.lang.Object> getSavedObjects()
Get all the saved objects. Used for stored prepared statements.- Returns:
- a list with all the saved objects
-
getCursorInfo
java.lang.Object getCursorInfo()
Get the saved cursor info. Used for stored prepared statements.- Returns:
- Object the cursor info
-
getActivationClass
GeneratedClass getActivationClass() throws StandardException
Get the class generated for this prepared statement. Used to confirm compatability with auxilary structures.- Throws:
StandardException
- on error obtaining class (probably when a stored prepared statement is loading)
-
upToDate
boolean upToDate(GeneratedClass gc) throws StandardException
Checks whether this PreparedStatement is up to date and its activation class is identical to the supplied generated class. A call to
upToDate(gc)
is supposed to perform the same work as the following code in one atomic operation:getActivationClass() == gc && upToDate()
- Parameters:
gc
- a generated class that must be identical togetActivationClass()
for this method to returntrue
- Returns:
true
if this statement is up to date and its activation class is identical togc
,false
otherwise- Throws:
StandardException
- See Also:
PreparedStatement.upToDate()
,getActivationClass()
-
finish
void finish(LanguageConnectionContext lcc)
Mark the statement as unusable, i.e. the system is finished with it and no one should be able to use it.
-
needsSavepoint
boolean needsSavepoint()
Does this statement need a savpoint- Returns:
- true if needs a savepoint
-
getClone
ExecPreparedStatement getClone() throws StandardException
Get a new prepared statement that is a shallow copy of the current one.- Returns:
- a new prepared statement
- Throws:
StandardException
- on error
-
getUpdateMode
int getUpdateMode()
the update mode of the cursor- Returns:
- The update mode of the cursor
-
getTargetTable
ExecCursorTableReference getTargetTable()
the target table of the cursor- Returns:
- target table of the cursor
-
hasUpdateColumns
boolean hasUpdateColumns()
Check if this prepared statement has a cursor with columns that can be updated.
-
isUpdateColumn
boolean isUpdateColumn(java.lang.String columnName)
Check if the specified column name is one of the update columns.
-
setValid
void setValid()
set this prepared statement to be valid
-
setSPSAction
void setSPSAction()
Indicate that the statement represents an SPS action
-
getRequiredPermissionsList
java.util.List<StatementPermission> getRequiredPermissionsList()
- Returns:
- the list of permissions required to execute this statement. May be null if the database does not use SQL standard authorization
-
incrementExecutionCount
int incrementExecutionCount()
Increment and return the execution count for this statement.- Returns:
- execution count for this statement after the last compilation
-
getInitialRowCount
long getInitialRowCount(int rsNum, long currentRowCount)
Get the initial row count of the specified result set. If the initial row count has not yet been set, initialize it with the value of the current row count.- Parameters:
rsNum
- the result set to get the initial row count forcurrentRowCount
- the current row count for the result set- Returns:
- the row count from the first execution of the result set
-
setStalePlanCheckInterval
void setStalePlanCheckInterval(int interval)
Set the stale plan check interval.- Parameters:
interval
- the stale plan check interval
-
getStalePlanCheckInterval
int getStalePlanCheckInterval()
Get the stale plan check interval.- Returns:
- the stale plan check interval, or zero if it has not been initialized yet
-
-