|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.derby.impl.sql.execute.BaseActivation
BaseActivation provides the fundamental support we expect all activations to have. Doesn't actually implement any of the activation interface, expects the subclasses to do that.
| Constructor Summary | |
protected |
BaseActivation()
|
| Method Summary | |
void |
addWarning(java.sql.SQLWarning w)
Add a warning to the activation |
static void |
allocateQualArray(Qualifier[][] qualifiers,
int position,
int length)
Allocate an array of qualifiers and initialize in Qualifier[][] |
boolean |
checkIfThisActivationHasHoldCursor(java.lang.String tableName)
Temporary tables can be declared with ON COMMIT DELETE ROWS. |
protected void |
checkPositionedStatement(java.lang.String cursorName,
java.lang.String psName)
|
void |
checkStatementValidity()
Check the validity of the current executing statement. |
void |
clearCurrentRow(int resultSetNumber)
Clear the current row for the specified ResultSet. |
void |
clearHeapConglomerateController()
Clear the ConglomerateController to be used for an update or delete. |
void |
clearIndexScanInfo()
Clear the info for the index to be re-used for update/delete. |
void |
clearParentResultSets()
prepared statement use the same activation for multiple execution. |
void |
clearResultSet()
Sets the ResultSet to be returned by getResultSet() to null. |
void |
clearWarnings()
Clear the activation's warnings. |
void |
close()
Closing an activation marks it as unusable. |
protected void |
closeActivationAction()
A generated class can create its own closeActivationAction method to invoke special logic when the activation is closed. |
java.lang.Object |
e0()
|
java.lang.Object |
e1()
|
java.lang.Object |
e2()
|
java.lang.Object |
e3()
|
java.lang.Object |
e4()
|
java.lang.Object |
e5()
|
java.lang.Object |
e6()
|
java.lang.Object |
e7()
|
java.lang.Object |
e8()
|
java.lang.Object |
e9()
|
int[] |
getAutoGeneratedKeysColumnIndexes()
Returns the column positions array of columns requested in auto-generated keys resultset for this avtivation. |
java.lang.String[] |
getAutoGeneratedKeysColumnNames()
Returns the column names array of columns requested in auto-generated keys resultset for this avtivation. |
boolean |
getAutoGeneratedKeysResultsetMode()
Returns true if auto-generated keys resultset request was made for this avtivation. |
protected java.util.Calendar |
getCalendar()
Return a calendar for use by this activation. |
protected DataValueDescriptor |
getColumnFromRow(int rsNumber,
int colId)
|
ConstantAction |
getConstantAction()
|
ContextManager |
getContextManager()
Get the Current ContextManager. |
java.sql.Connection |
getCurrentConnection()
Used to get a proxy for the current connection. |
java.lang.String |
getCursorName()
get the cursor name. |
CursorResultSet |
getCursorResultSet()
Used in CurrentOfResultSet to get to the cursor result set for a cursor. |
DataValueFactory |
getDataValueFactory()
Used by activations to generate data values. |
NumberDataValue |
getDB2Length(DataValueDescriptor value,
int constantLength,
NumberDataValue reUse)
Compute the DB2 compatible length of a value. |
TableDescriptor |
getDDLTableDescriptor()
Get the TableDescriptor for the target of DDL. |
java.sql.ResultSet[][] |
getDynamicResults()
Real implementations of this method are provided by a generated class. |
(package private) ExecutionContext |
getExecutionContext()
Get the ExecutionContext. |
protected abstract int |
getExecutionCount()
|
ExecutionFactory |
getExecutionFactory()
Used in activations for generating rows. |
boolean |
getForCreateTable()
Get whether or not this activation is for create table. |
CursorResultSet |
getForUpdateIndexScan()
|
GeneratedClass |
getGC()
Get the GeneratedClass object for this object. |
ConglomerateController |
getHeapConglomerateController()
Get the ConglomerateController, if any, that has already been opened for the heap when scaning for an update or delete. |
long |
getIndexConglomerateNumber()
Get the conglomerate number of the index, if any, that has already been opened for scaning for an update or delete. |
ScanController |
getIndexScanController()
Get the ScanController, if any, that has already been opened for the index when scaning for an update or delete. |
LanguageConnectionContext |
getLanguageConnectionContext()
Get the language connection factory associated with this connection |
int |
getMaxDynamicResults()
Real implementations of this method are provided by a generated class. |
int |
getMaxRows()
Get the maximum # of rows. (# of rows that can be returned by a ResultSet. 0 means no limit.) |
GeneratedMethod |
getMethod(java.lang.String methodName)
|
int |
getNumSubqueries()
Get the number of subqueries in the entire query. |
ParameterValueSet |
getParameterValueSet()
return the parameters. |
java.util.Vector |
getParentResultSet(java.lang.String resultSetId)
get the reference to parent table ResultSets, that will be needed by the referential action dependent table scans. |
java.util.Hashtable |
getParentResultSets()
|
ExecPreparedStatement |
getPreparedStatement()
Get the prepared statement that this activation is for. |
ResultDescription |
getResultDescription()
Get the result description for this activation, if it has one. |
ResultSet |
getResultSet()
Returns the current result set for this activation, i.e. |
ResultSetFactory |
getResultSetFactory()
Used in the execute method of activations for generating the result sets that they concatenate together. |
boolean |
getResultSetHoldability()
Return the holdability of this activation. |
protected abstract java.util.Vector |
getRowCountCheckVector()
|
RowLocation |
getRowLocationTemplate(int itemNumber)
Get the saved RowLocation. |
boolean |
getScrollable()
|
protected DataValueDescriptor |
getSetAutoincrementValue(int columnPosition,
long increment)
|
protected abstract int |
getStalePlanCheckInterval()
|
CursorResultSet |
getTargetResultSet()
Used in CurrentOfResultSet to get to the target result set for a cursor. |
java.sql.ResultSet |
getTargetVTI()
Get the ResultSet for the target of an update/delete to a VTI. |
TransactionController |
getTransactionController()
Get the Execution TransactionController associated with this activation/lcc. |
java.sql.SQLWarning |
getWarnings()
Returns the chained list of warnings. |
void |
informOfRowCount(NoPutResultSet resultSet,
long currentRowCount)
Tell this activation that the given ResultSet was found to have the given number of rows. |
void |
initFromContext(Context context)
Initialize the generated class from a context. |
boolean |
isClosed()
Find out if the activation closed or not. |
boolean |
isCursorActivation()
Is this Activation for a cursor? |
boolean |
isInUse()
Is the activation in use? |
boolean |
isSingleExecution()
Returns true if this Activation is only going to be used for one execution. |
void |
markUnused()
Mark the activation as unused. |
NoPutResultSet |
materializeResultSetIfPossible(NoPutResultSet rs)
|
protected static void |
nullToPrimitiveTest(DataValueDescriptor dvd,
java.lang.String primitiveType)
|
static void |
reinitializeQualifiers(Qualifier[][] qualifiers)
Reinitialize all Qualifiers in an array of Qualifiers. |
void |
reset()
This is a partial implementation of reset. |
void |
setAutoGeneratedKeysResultsetInfo(int[] columnIndexes,
java.lang.String[] columnNames)
Set the auto-generated keys resultset mode to true for this activation. |
static void |
setColumnPosition(int[] columnPositions,
int positionToSet,
int column)
Set a column position in an array of column positions. |
void |
setCurrentRow(ExecRow currentRow,
int resultSetNumber)
Remember the row for the specified ResultSet. |
void |
setCursorName(java.lang.String cursorName)
remember the cursor name |
void |
setDDLTableDescriptor(TableDescriptor td)
Save the TableDescriptor for the target of DDL so that it can be passed between the various ConstantActions during execution. |
protected abstract void |
setExecutionCount(int newValue)
|
void |
setForCreateTable()
Mark the Activation as being for create table. |
void |
setForUpdateIndexScan(CursorResultSet forUpdateIndexScan)
beetle 3865: updateable cursor using index. |
void |
setGC(GeneratedClass gc)
Set the Generated Class. |
void |
setHeapConglomerateController(ConglomerateController updateHeapCC)
Set the ConglomerateController to be used for an update or delete. |
void |
setIndexConglomerateNumber(long indexConglomerateNumber)
Set the conglomerate number of the index to be used for an update or delete, when scanning an index that will also be updated (Saves opening the ScanController twice.) |
void |
setIndexScanController(ScanController indexSC)
Set the ScanController to be used for an update or delete, when scanning an index that will also be updated (Saves opening the ScanController twice.) |
void |
setMaxRows(int maxRows)
Set the maximum # of rows. (# of rows that can be returned by a ResultSet. 0 means no limit.) |
void |
setParameters(ParameterValueSet parameterValues,
DataTypeDescriptor[] parameterTypes)
Sets the parameter values for this execution of the statement. |
protected void |
setParameterValueSet(int paramCount,
boolean hasReturnParam)
|
void |
setParentResultSet(TemporaryRowHolder rs,
java.lang.String resultSetId)
|
static void |
setQualifier(Qualifier[][] qualifiers,
Qualifier qualifier,
int position_1,
int position_2)
Set a Qualifier in a 2 dimensional array of Qualifiers. |
void |
setResultSetHoldability(boolean resultSetHoldability)
Set current resultset holdability. |
protected abstract void |
setRowCountCheckVector(java.util.Vector newValue)
|
void |
setSingleExecution()
Set this Activation for a single execution. |
protected abstract void |
setStalePlanCheckInterval(int newValue)
|
void |
setTargetVTI(java.sql.ResultSet targetVTI)
Save the ResultSet for the target of an update/delete to a VTI. |
void |
setupActivation(ExecPreparedStatement ps,
boolean scrollable)
Link this activation with its PreparedStatement. |
private void |
shouldWeCheckRowCounts()
|
void |
startExecution()
The subclass calls this method when it begins an execution. |
void |
throwIfClosed(java.lang.String op)
Various activation methods need to disallow their invocation if the activation is closed. |
void |
throwIfMissingParms()
Throw an exception if any parameters are uninitialized. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.derby.iapi.sql.Activation |
execute |
| Methods inherited from interface org.apache.derby.iapi.services.loader.GeneratedByteCode |
postConstructor |
| Field Detail |
protected ResultSetFactory rsFactory
protected ExecutionFactory exFactory
protected DataValueFactory dvFactory
protected LanguageConnectionContext lcc
protected ContextManager cm
protected ExecutionContext ec
protected ExecPreparedStatement preStmt
protected ResultSet resultSet
protected ResultDescription resultDescription
protected boolean closed
private java.lang.String cursorName
protected int numSubqueries
private boolean singleExecution
private boolean inUse
private java.sql.ResultSet targetVTI
private java.sql.SQLWarning warnings
private GeneratedClass gc
private boolean checkRowCounts
private java.util.HashSet rowCountsCheckedThisExecution
private static final long MAX_SQRT
private static final int TEN_PERCENT_THRESHOLD
private ConglomerateController updateHeapCC
private ScanController indexSC
private long indexConglomerateNumber
private TableDescriptor ddlTableDescriptor
private int maxRows
private boolean forCreateTable
private boolean scrollable
private boolean resultSetHoldability
private CursorResultSet forUpdateIndexScan
private boolean autoGeneratedKeysResultSetMode
private int[] autoGeneratedKeysColumnIndexes
private java.lang.String[] autoGeneratedKeysColumnNames
protected int indexOfSessionTableNamesInSavedObjects
protected ExecRow[] row
protected ParameterValueSet pvs
protected CursorResultSet[] raParentResultSets
protected java.util.Hashtable parentResultSets
private java.util.Calendar cal
| Constructor Detail |
protected BaseActivation()
| Method Detail |
public final void initFromContext(Context context)
GeneratedByteCode
initFromContext in interface GeneratedByteCodepublic final ExecPreparedStatement getPreparedStatement()
Activation
getPreparedStatement in interface Activationpublic ConstantAction getConstantAction()
getConstantAction in interface Activation
public final void checkStatementValidity()
throws StandardException
Activation
checkStatementValidity in interface ActivationStandardException
public final void setupActivation(ExecPreparedStatement ps,
boolean scrollable)
public ResultSet getResultSet()
Activation
getResultSet in interface Activationpublic void clearResultSet()
Activation
clearResultSet in interface Activationpublic RowLocation getRowLocationTemplate(int itemNumber)
getRowLocationTemplate in interface ActivationitemNumber - The saved item number.
public ResultDescription getResultDescription()
Activation
getResultDescription in interface Activation
public void reset()
throws StandardException
All subclasses must call super.reset() and then do their cleanup.
The execute call must set the resultSet field to be the resultSet that it has returned.
reset in interface ActivationStandardException - on error
public final void close()
throws StandardException
close in interface ActivationStandardException - on error
protected void closeActivationAction()
throws java.lang.Exception
java.lang.Exceptionpublic boolean isClosed()
isClosed in interface Activationpublic void setSingleExecution()
setSingleExecution in interface ActivationActivation.setSingleExecution()public boolean isSingleExecution()
isSingleExecution in interface ActivationActivation.isSingleExecution()public int getNumSubqueries()
getNumSubqueries in interface Activationpublic boolean isCursorActivation()
Activation
isCursorActivation in interface ActivationActivation.isCursorActivation()public final void setGC(GeneratedClass gc)
GeneratedByteCode
setGC in interface GeneratedByteCodepublic final GeneratedClass getGC()
GeneratedByteCode
getGC in interface GeneratedByteCode
public final GeneratedMethod getMethod(java.lang.String methodName)
throws StandardException
getMethod in interface GeneratedByteCodeStandardException
public java.lang.Object e0()
throws StandardException
e0 in interface GeneratedByteCodeStandardException
public java.lang.Object e1()
throws StandardException
e1 in interface GeneratedByteCodeStandardException
public java.lang.Object e2()
throws StandardException
e2 in interface GeneratedByteCodeStandardException
public java.lang.Object e3()
throws StandardException
e3 in interface GeneratedByteCodeStandardException
public java.lang.Object e4()
throws StandardException
e4 in interface GeneratedByteCodeStandardException
public java.lang.Object e5()
throws StandardException
e5 in interface GeneratedByteCodeStandardException
public java.lang.Object e6()
throws StandardException
e6 in interface GeneratedByteCodeStandardException
public java.lang.Object e7()
throws StandardException
e7 in interface GeneratedByteCodeStandardException
public java.lang.Object e8()
throws StandardException
e8 in interface GeneratedByteCodeStandardException
public java.lang.Object e9()
throws StandardException
e9 in interface GeneratedByteCodeStandardExceptionpublic boolean checkIfThisActivationHasHoldCursor(java.lang.String tableName)
checkIfThisActivationHasHoldCursor in interface Activationpublic void setCursorName(java.lang.String cursorName)
setCursorName in interface ActivationcursorName - The cursor name to use.public java.lang.String getCursorName()
Activations that do support cursors will override this.
getCursorName in interface Activationpublic void setResultSetHoldability(boolean resultSetHoldability)
Activation
setResultSetHoldability in interface ActivationresultSetHoldability - The new resultset holdability.
public boolean getResultSetHoldability()
Activation
getResultSetHoldability in interface Activation
public void setAutoGeneratedKeysResultsetInfo(int[] columnIndexes,
java.lang.String[] columnNames)
Activation
setAutoGeneratedKeysResultsetInfo in interface ActivationcolumnIndexes - Request specific columns in auto-generated keys
resultset by passing column positions. null means no specific columns
requested by positioncolumnNames - Request specific columns in auto-generated keys
resultset by passing column names. null means no specific columns
requested by position
Activation.setAutoGeneratedKeysResultsetInfo(int[], java.lang.String[])public boolean getAutoGeneratedKeysResultsetMode()
Activation
getAutoGeneratedKeysResultsetMode in interface ActivationActivation.getAutoGeneratedKeysResultsetMode()public int[] getAutoGeneratedKeysColumnIndexes()
Activation
getAutoGeneratedKeysColumnIndexes in interface ActivationActivation.getAutoGeneratedKeysColumnIndexes()public java.lang.String[] getAutoGeneratedKeysColumnNames()
Activation
getAutoGeneratedKeysColumnNames in interface ActivationActivation.getAutoGeneratedKeysColumnNames()public ResultSetFactory getResultSetFactory()
public ExecutionFactory getExecutionFactory()
getExecutionFactory in interface Activationpublic CursorResultSet getTargetResultSet()
getTargetResultSet in interface CursorActivation
protected DataValueDescriptor getSetAutoincrementValue(int columnPosition,
long increment)
throws StandardException
StandardExceptionpublic CursorResultSet getCursorResultSet()
getCursorResultSet in interface CursorActivation
public void throwIfClosed(java.lang.String op)
throws StandardException
The code to write to generate the call to this is approximately:
StandardException - thrown if closed
public static void setColumnPosition(int[] columnPositions,
int positionToSet,
int column)
columnPositions - The array of column positionspositionToSet - The place to put the column positioncolumn - The column position
public static void allocateQualArray(Qualifier[][] qualifiers,
int position,
int length)
qualifiers - The array of Qualifier arrays.position - The position in the array to setlength - The array length of the qualifier array to allocate.
public static void setQualifier(Qualifier[][] qualifiers,
Qualifier qualifier,
int position_1,
int position_2)
qualifiers - The array of Qualifiersqualifier - The Qualifierposition_1 - The Nth array index into qualifiers[N][M]public static void reinitializeQualifiers(Qualifier[][] qualifiers)
qualifiers - The array of Qualifierspublic final void markUnused()
markUnused in interface Activationpublic final boolean isInUse()
isInUse in interface Activationpublic void addWarning(java.sql.SQLWarning w)
Activation
addWarning in interface ActivationActivation.addWarning(java.sql.SQLWarning)public java.sql.SQLWarning getWarnings()
Activation
getWarnings in interface ActivationActivation.getWarnings()public void clearWarnings()
Activation
clearWarnings in interface ActivationActivation.clearWarnings()
protected static void nullToPrimitiveTest(DataValueDescriptor dvd,
java.lang.String primitiveType)
throws StandardException
StandardException - on error
public void informOfRowCount(NoPutResultSet resultSet,
long currentRowCount)
throws StandardException
Activation
informOfRowCount in interface ActivationStandardException - Thrown on errorActivation.informOfRowCount(org.apache.derby.iapi.sql.execute.NoPutResultSet, long)
public void startExecution()
throws StandardException
StandardException - Thrown on errorpublic ConglomerateController getHeapConglomerateController()
Activation
getHeapConglomerateController in interface ActivationActivation.getHeapConglomerateController()public void setHeapConglomerateController(ConglomerateController updateHeapCC)
Activation
setHeapConglomerateController in interface ActivationupdateHeapCC - The ConglomerateController to reuse for the update or delete.
Activation.setHeapConglomerateController(org.apache.derby.iapi.store.access.ConglomerateController)public void clearHeapConglomerateController()
Activation
clearHeapConglomerateController in interface ActivationActivation.clearHeapConglomerateController()public ScanController getIndexScanController()
Activation
getIndexScanController in interface ActivationActivation.getIndexScanController()public void setIndexScanController(ScanController indexSC)
Activation
setIndexScanController in interface ActivationindexSC - The ScanController to reuse for the update or delete.
Activation.setIndexScanController(org.apache.derby.iapi.store.access.ScanController)public long getIndexConglomerateNumber()
Activation
getIndexConglomerateNumber in interface ActivationActivation.getIndexConglomerateNumber()public void setIndexConglomerateNumber(long indexConglomerateNumber)
Activation
setIndexConglomerateNumber in interface ActivationindexConglomerateNumber - The conglomerate number of the index to reuse for the update or delete.
Activation.setIndexConglomerateNumber(long)public void clearIndexScanInfo()
Activation
clearIndexScanInfo in interface ActivationActivation.clearIndexScanInfo()public void setForCreateTable()
Activation
setForCreateTable in interface ActivationActivation.setForCreateTable()public boolean getForCreateTable()
Activation
getForCreateTable in interface ActivationActivation.getForCreateTable()public void setDDLTableDescriptor(TableDescriptor td)
Activation
setDDLTableDescriptor in interface ActivationActivation.setDDLTableDescriptor(org.apache.derby.iapi.sql.dictionary.TableDescriptor)public TableDescriptor getDDLTableDescriptor()
Activation
getDDLTableDescriptor in interface ActivationActivation.getDDLTableDescriptor()public void setMaxRows(int maxRows)
Activation
setMaxRows in interface ActivationmaxRows - Maximum # of rows. (0 means no limit.)
Activation.setMaxRows(int)public int getMaxRows()
Activation
getMaxRows in interface ActivationActivation.getMaxRows()public void setTargetVTI(java.sql.ResultSet targetVTI)
Activation
setTargetVTI in interface Activationpublic java.sql.ResultSet getTargetVTI()
Activation
getTargetVTI in interface Activation
private void shouldWeCheckRowCounts()
throws StandardException
StandardExceptionprotected abstract int getExecutionCount()
protected abstract void setExecutionCount(int newValue)
protected abstract java.util.Vector getRowCountCheckVector()
protected abstract void setRowCountCheckVector(java.util.Vector newValue)
protected abstract int getStalePlanCheckInterval()
protected abstract void setStalePlanCheckInterval(int newValue)
public final boolean getScrollable()
protected final void setParameterValueSet(int paramCount,
boolean hasReturnParam)
public ParameterValueSet getParameterValueSet()
getParameterValueSet in interface Activation
public void setParameters(ParameterValueSet parameterValues,
DataTypeDescriptor[] parameterTypes)
throws StandardException
ActivationHas no effect if the activation has been closed.
NOTE: The setParameters() method is currently unimplemented. A statement with parameters will generate its own ParameterValueSet, which can be gotten with the getParameterValueSet() method (above). The idea behind setParameters() is to improve performance when operating across a network by allowing all the parameters to be set in one call, as opposed to one call per parameter.
setParameters in interface ActivationparameterValues - The values of the parameters.
StandardException
public void throwIfMissingParms()
throws StandardException
StandardException - Thrown if any parameters
are unitialized
public void setCurrentRow(ExecRow currentRow,
int resultSetNumber)
setCurrentRow in interface ActivationcurrentRow - The row to be operated upon.resultSetNumber - The resultSetNumber for the current ResultSet
public void clearCurrentRow(int resultSetNumber)
clearCurrentRow in interface ActivationresultSetNumber - The resultSetNumber for the current ResultSet
protected final DataValueDescriptor getColumnFromRow(int rsNumber,
int colId)
throws StandardException
StandardException
protected void checkPositionedStatement(java.lang.String cursorName,
java.lang.String psName)
throws StandardException
StandardException
public NoPutResultSet materializeResultSetIfPossible(NoPutResultSet rs)
throws StandardException
StandardException
public void setParentResultSet(TemporaryRowHolder rs,
java.lang.String resultSetId)
setParentResultSet in interface Activationpublic java.util.Vector getParentResultSet(java.lang.String resultSetId)
getParentResultSet in interface Activationpublic java.util.Hashtable getParentResultSets()
getParentResultSets in interface Activationpublic void clearParentResultSets()
clearParentResultSets in interface Activationpublic void setForUpdateIndexScan(CursorResultSet forUpdateIndexScan)
setForUpdateIndexScan in interface Activationpublic CursorResultSet getForUpdateIndexScan()
getForUpdateIndexScan in interface Activationprotected java.util.Calendar getCalendar()
public final LanguageConnectionContext getLanguageConnectionContext()
getLanguageConnectionContext in interface Activationpublic final TransactionController getTransactionController()
Activation
getTransactionController in interface ActivationExecutionContext getExecutionContext()
public ContextManager getContextManager()
public DataValueFactory getDataValueFactory()
getDataValueFactory in interface Activation
public java.sql.Connection getCurrentConnection()
throws java.sql.SQLException
java.sql.SQLException - Thrown on failure to get connectionpublic java.sql.ResultSet[][] getDynamicResults()
getDynamicResults in interface Activationpublic int getMaxDynamicResults()
getMaxDynamicResults in interface Activation
public NumberDataValue getDB2Length(DataValueDescriptor value,
int constantLength,
NumberDataValue reUse)
throws StandardException
value - constantLength - The length, if it is a constant modulo null/not null. -1 if the length is not constantreUse - If non-null then re-use this as a container for the length
StandardException
|
Built on Tue 2006-10-10 19:23:47+0200, from revision exported | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||