Package org.apache.derby.impl.sql
Class GenericStorablePreparedStatement
- java.lang.Object
-
- org.apache.derby.impl.sql.GenericPreparedStatement
-
- org.apache.derby.impl.sql.GenericStorablePreparedStatement
-
- All Implemented Interfaces:
java.io.Externalizable
,java.io.Serializable
,Dependable
,Formatable
,TypedFormat
,Dependent
,ExecPreparedStatement
,PreparedStatement
,StorablePreparedStatement
public class GenericStorablePreparedStatement extends GenericPreparedStatement implements Formatable, StorablePreparedStatement
Prepared statement that can be made persistent.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private ByteArray
byteCode
private java.lang.String
className
-
Fields inherited from class org.apache.derby.impl.sql.GenericPreparedStatement
activationClass, beginCompileTimestamp, bindTime, compileTime, endCompileTimestamp, executionConstants, generateTime, invalidatedWhileCompiling, isAtomic, isValid, optimizeTime, paramTypeDescriptors, parseTime, requiredPermissionsList, resultDesc, savedObjects, sourceTxt, spsAction, statement, targetTable, updateColumns, updateMode, UUIDString, UUIDValue
-
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
-
-
Constructor Summary
Constructors Constructor Description GenericStorablePreparedStatement()
Niladic constructor, for formatable only.GenericStorablePreparedStatement(Statement stmt)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description GeneratedClass
getActivationClass()
Get and load the activation class.(package private) ByteArray
getByteCodeSaver()
Get our byte code array.private static Context
getContext(java.lang.String contextID)
Privileged lookup of a Context.int
getTypeFormatId()
Get the formatID which corresponds to this class.boolean
isStorable()
void
loadGeneratedClass()
Load up the class from the saved bytes.void
readExternal(java.io.ObjectInput in)
(package private) void
setActivationClass(GeneratedClass ac)
java.lang.String
toString()
void
writeExternal(java.io.ObjectOutput out)
-
Methods inherited from class org.apache.derby.impl.sql.GenericPreparedStatement
beginCompiling, completeCompile, endCompiling, execute, executeSubStatement, executeSubStatement, finish, getActivation, getBeginCompileTimestamp, getBindTimeInMillis, getClassType, getClone, getCompileTimeInMillis, getCompileTimeWarnings, getConstantAction, getCursorInfo, getDependableFinder, getEndCompileTimestamp, getGenerateTimeInMillis, getInitialRowCount, getObjectID, getObjectName, getOptimizeTimeInMillis, getParameterType, getParameterTypes, getParseTimeInMillis, getRequiredPermissionsList, getResultDescription, getSavedObject, getSavedObjects, getSource, getSPSName, getStalePlanCheckInterval, getTargetTable, getUpdateMode, getVersionCounter, hasUpdateColumns, incrementExecutionCount, incrementVersionCounter, isAtomic, isCompiling, isPersistent, isUpdateColumn, isValid, makeInvalid, needsSavepoint, prepareToInvalidate, referencesSessionSchema, referencesSessionSchema, rePrepare, rePrepare, setCacheHolder, setCompileTimeMillis, setCompileTimeWarnings, setConstantAction, setCursorInfo, setExecuteStatementNameAndSchema, setIsAtomic, setNeedsSavepoint, setRequiredPermissionsList, setSavedObjects, setSource, setSPSAction, setSPSName, setStalePlanCheckInterval, setValid, upToDate, upToDate
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
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.execute.ExecPreparedStatement
finish, getClone, getConstantAction, getCursorInfo, getInitialRowCount, getRequiredPermissionsList, getSavedObject, getSavedObjects, getStalePlanCheckInterval, getTargetTable, getUpdateMode, hasUpdateColumns, incrementExecutionCount, isUpdateColumn, needsSavepoint, setSource, setSPSAction, setStalePlanCheckInterval, setValid, upToDate
-
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
-
-
-
-
Field Detail
-
byteCode
private ByteArray byteCode
-
className
private java.lang.String className
-
-
Constructor Detail
-
GenericStorablePreparedStatement
public GenericStorablePreparedStatement()
Niladic constructor, for formatable only.
-
GenericStorablePreparedStatement
GenericStorablePreparedStatement(Statement stmt)
-
-
Method Detail
-
getByteCodeSaver
ByteArray getByteCodeSaver()
Get our byte code array. Used by others to save off our byte code for us.- Overrides:
getByteCodeSaver
in classGenericPreparedStatement
- Returns:
- the byte code saver
-
getActivationClass
public GeneratedClass getActivationClass() throws StandardException
Get and load the activation class. Will always return a loaded/valid class or null if the class cannot be loaded.- Specified by:
getActivationClass
in interfaceExecPreparedStatement
- Overrides:
getActivationClass
in classGenericPreparedStatement
- Returns:
- the generated class, or null if the class cannot be loaded
- Throws:
StandardException
- on error
-
setActivationClass
void setActivationClass(GeneratedClass ac)
- Overrides:
setActivationClass
in classGenericPreparedStatement
-
loadGeneratedClass
public void loadGeneratedClass() throws StandardException
Load up the class from the saved bytes.- Specified by:
loadGeneratedClass
in interfaceStorablePreparedStatement
- Throws:
StandardException
- on error
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
- Specified by:
writeExternal
in interfacejava.io.Externalizable
- Throws:
java.io.IOException
- on error
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
- Specified by:
readExternal
in interfacejava.io.Externalizable
- Throws:
java.io.IOException
- on errorjava.lang.ClassNotFoundException
- on error- See Also:
Externalizable.readExternal(java.io.ObjectInput)
-
getTypeFormatId
public int getTypeFormatId()
Get the formatID which corresponds to this class.- Specified by:
getTypeFormatId
in interfaceTypedFormat
- Returns:
- the formatID of this class
-
isStorable
public boolean isStorable()
- Overrides:
isStorable
in classGenericPreparedStatement
-
toString
public java.lang.String toString()
- Overrides:
toString
in classGenericPreparedStatement
-
getContext
private static Context getContext(java.lang.String contextID)
Privileged lookup of a Context. Must be private so that user code can't call this entry point.
-
-