Package org.apache.derby.impl.sql
Class GenericStatement
java.lang.Object
org.apache.derby.impl.sql.GenericStatement
- All Implemented Interfaces:
Statement
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final SchemaDescriptor
private final boolean
private GenericPreparedStatement
private int
private final String
-
Constructor Summary
ConstructorsConstructorDescriptionGenericStatement
(SchemaDescriptor compilationSchema, String statementText, boolean isForReadOnly) Constructor for a Statement given the text of the statement in a String -
Method Summary
Modifier and TypeMethodDescriptionboolean
private static long
Return thePreparedStatement
currently associated with this statement.Return the SQL string that this statement is for.int
hashCode()
Generates an execution plan without executing it.prepare
(LanguageConnectionContext lcc, boolean forMetaData) Generates an execution plan without executing it.prepareStorable
(LanguageConnectionContext lcc, PreparedStatement ps, Object[] paramDefaults, SchemaDescriptor spsSchema, boolean internalSQL) Generates an execution plan given a set of named parameters.private PreparedStatement
prepMinion
(LanguageConnectionContext lcc, boolean cacheMe, Object[] paramDefaults, SchemaDescriptor spsSchema, boolean internalSQL) private void
walkAST
(LanguageConnectionContext lcc, Visitable queryTree, int phase) Walk the AST, using a (user-supplied) Visitor
-
Field Details
-
compilationSchema
-
statementText
-
isForReadOnly
private final boolean isForReadOnly -
prepareIsolationLevel
private int prepareIsolationLevel -
preparedStmt
-
-
Constructor Details
-
GenericStatement
public GenericStatement(SchemaDescriptor compilationSchema, String statementText, boolean isForReadOnly) Constructor for a Statement given the text of the statement in a String- Parameters:
compilationSchema
- schemastatementText
- The text of the statementisForReadOnly
- if the statement is opened with level CONCUR_READ_ONLY
-
-
Method Details
-
prepare
Description copied from interface:Statement
Generates an execution plan without executing it.- Specified by:
prepare
in interfaceStatement
- Returns:
- A PreparedStatement that allows execution of the execution plan.
- Throws:
StandardException
- Thrown if this is an execution-only version of the module (the prepare() method relies on compilation).
-
prepare
public PreparedStatement prepare(LanguageConnectionContext lcc, boolean forMetaData) throws StandardException Description copied from interface:Statement
Generates an execution plan without executing it.- Specified by:
prepare
in interfaceStatement
- Parameters:
lcc
- the language connection contextforMetaData
- If this statement is for a metadata call then we will allow internal sql syntax on such statement. This internal sql syntax is not available to a user sql statement.- Returns:
- A PreparedStatement that allows execution of the execution plan.
- Throws:
StandardException
- Thrown if this is an execution-only version of the module (the prepare() method relies on compilation).
-
prepMinion
private PreparedStatement prepMinion(LanguageConnectionContext lcc, boolean cacheMe, Object[] paramDefaults, SchemaDescriptor spsSchema, boolean internalSQL) throws StandardException - Throws:
StandardException
-
walkAST
private void walkAST(LanguageConnectionContext lcc, Visitable queryTree, int phase) throws StandardException Walk the AST, using a (user-supplied) Visitor- Throws:
StandardException
-
prepareStorable
public PreparedStatement prepareStorable(LanguageConnectionContext lcc, PreparedStatement ps, Object[] paramDefaults, SchemaDescriptor spsSchema, boolean internalSQL) throws StandardException Generates an execution plan given a set of named parameters. Does so for a storable prepared statement.- Specified by:
prepareStorable
in interfaceStatement
- Parameters:
lcc
- Compiler state variable.ps
- Prepared statementparamDefaults
- Parameter defaultsspsSchema
- schema of the stored prepared statement- Returns:
- A PreparedStatement that allows execution of the execution plan.
- Throws:
StandardException
- Thrown if this is an execution-only version of the module (the prepare() method relies on compilation).
-
getSource
Description copied from interface:Statement
Return the SQL string that this statement is for. -
getCompilationSchema
-
getCurrentTimeMillis
-
getPreparedStatement
Return thePreparedStatement
currently associated with this statement.- Returns:
- the prepared statement that is associated with this statement
-
equals
-
hashCode
public int hashCode()
-