| org.apache.derby.iapi.sql.PreparedStatement
PreparedStatement | public interface PreparedStatement extends Dependent,Provider(Code) | | The PreparedStatement interface provides methods to execute prepared
statements, store them, and get metadata about them.
author: Jeff Lichtman |
Method Summary | |
ResultSet | execute(Activation activation, boolean rollbackParentContext, long timeoutMillis) Execute the PreparedStatement and return results.
There is no executeQuery() or
executeUpdate(); a method is provided in
ResultSet to tell whether to expect rows to be returned.
Parameters: activation - The activation containing all the local stateto execute the plan. Parameters: rollbackParentContext - True if 1) the statement context isNOT a top-level context, AND 2) in the event of a statement-levelexception, the parent context needs to be rolled back, too. Parameters: timeoutMillis - timeout value in milliseconds. A ResultSet for a statement. | ResultSet | execute(LanguageConnectionContext lcc, boolean rollbackParentContext, long timeoutMillis) Simple form of execute(). | Activation | getActivation(LanguageConnectionContext lcc, boolean scrollable) PreparedStatements are re-entrant - that is, more than one
execution can be active at a time for a single prepared statement.
An Activation contains all the local state information to
execute a prepared statement (as opposed to the constant
information, such as literal values and code). | public Timestamp | getBeginCompileTimestamp() | public long | getBindTimeInMillis() Get the bind time for the associated query in milliseconds. | public long | getCompileTimeInMillis() Get the total compile time for the associated query in milliseconds. | public SQLWarning | getCompileTimeWarnings() Return any compile time warnings. | public Timestamp | getEndCompileTimestamp() | public long | getGenerateTimeInMillis() Get the generate time for the associated query in milliseconds. | public long | getOptimizeTimeInMillis() Get the optimize time for the associated query in milliseconds. | DataTypeDescriptor[] | getParameterTypes() Get an array of DataTypeDescriptors describing the types of the
parameters of this PreparedStatement. | public long | getParseTimeInMillis() Get the parse time for the associated query in milliseconds. | ResultDescription | getResultDescription() Get the ResultDescription for the statement. | String | getSPSName() Return the SPS Name for this statement. | String | getSource() Return the SQL string that this statement is for. | boolean | isAtomic() Returns whether or not this Statement requires should
behave atomically -- i.e. | void | rePrepare(LanguageConnectionContext lcc) Re-prepare the statement if it is not up to date or,
if requested, simply not optimal. | boolean | referencesSessionSchema() Return true if the query node for this statement references SESSION schema tables. | boolean | upToDate() Checks whether this PreparedStatement is up to date. |
execute | ResultSet execute(Activation activation, boolean rollbackParentContext, long timeoutMillis) throws StandardException(Code) | | Execute the PreparedStatement and return results.
There is no executeQuery() or
executeUpdate(); a method is provided in
ResultSet to tell whether to expect rows to be returned.
Parameters: activation - The activation containing all the local stateto execute the plan. Parameters: rollbackParentContext - True if 1) the statement context isNOT a top-level context, AND 2) in the event of a statement-levelexception, the parent context needs to be rolled back, too. Parameters: timeoutMillis - timeout value in milliseconds. A ResultSet for a statement. A ResultSet representsthe results returned from the statement, if any.Will return NULL if the plan for the PreparedStatementhas aged out of cache, or the plan is out of date. exception: StandardException - Thrown on failure |
getActivation | Activation getActivation(LanguageConnectionContext lcc, boolean scrollable) throws StandardException(Code) | | PreparedStatements are re-entrant - that is, more than one
execution can be active at a time for a single prepared statement.
An Activation contains all the local state information to
execute a prepared statement (as opposed to the constant
information, such as literal values and code). Each Activation
class contains the code specific to the prepared statement
represented by an instance of this class (PreparedStatement).
Parameters: lcc - The LanguageConnectionContext. The new activation. exception: StandardException - Thrown on failure |
getBeginCompileTimestamp | public Timestamp getBeginCompileTimestamp()(Code) | | Get the timestamp for the beginning of compilation
Timestamp The timestamp for the beginning of compilation. |
getBindTimeInMillis | public long getBindTimeInMillis()(Code) | | Get the bind time for the associated query in milliseconds.
long The bind time for the associated query in milliseconds. |
getCompileTimeInMillis | public long getCompileTimeInMillis()(Code) | | Get the total compile time for the associated query in milliseconds.
Compile time can be divided into parse, bind, optimize and generate times.
long The total compile time for the associated query in milliseconds. |
getCompileTimeWarnings | public SQLWarning getCompileTimeWarnings()(Code) | | Return any compile time warnings. Null if no warnings exist.
|
getEndCompileTimestamp | public Timestamp getEndCompileTimestamp()(Code) | | Get the timestamp for the end of compilation
Timestamp The timestamp for the end of compilation. |
getGenerateTimeInMillis | public long getGenerateTimeInMillis()(Code) | | Get the generate time for the associated query in milliseconds.
long The generate time for the associated query in milliseconds. |
getOptimizeTimeInMillis | public long getOptimizeTimeInMillis()(Code) | | Get the optimize time for the associated query in milliseconds.
long The optimize time for the associated query in milliseconds. |
getParameterTypes | DataTypeDescriptor[] getParameterTypes()(Code) | | Get an array of DataTypeDescriptors describing the types of the
parameters of this PreparedStatement. The Nth element of the array
describes the Nth parameter.
An array of DataTypeDescriptors telling thetype, length, precision, scale, etc. of eachparameter of this PreparedStatement. |
getParseTimeInMillis | public long getParseTimeInMillis()(Code) | | Get the parse time for the associated query in milliseconds.
long The parse time for the associated query in milliseconds. |
getResultDescription | ResultDescription getResultDescription()(Code) | | Get the ResultDescription for the statement. The ResultDescription
describes what the results look like: what are the rows and columns?
This is available here and on the ResultSet so that users can
see the shape of the result before they execute.
A ResultDescription describing the results. |
getSPSName | String getSPSName()(Code) | | Return the SPS Name for this statement.
the SPS Name for this statement |
getSource | String getSource()(Code) | | Return the SQL string that this statement is for.
the SQL string this statement is for. |
isAtomic | boolean isAtomic()(Code) | | Returns whether or not this Statement requires should
behave atomically -- i.e. whether a user is permitted
to do a commit/rollback during the execution of this
statement.
boolean Whether or not this Statement is atomic |
rePrepare | void rePrepare(LanguageConnectionContext lcc) throws StandardException(Code) | | Re-prepare the statement if it is not up to date or,
if requested, simply not optimal.
If there are open cursors using this prepared statement,
then we will not be able to recompile the statement.
Parameters: lcc - The LanguageConnectionContext. exception: StandardException - thrown if unable to perform |
referencesSessionSchema | boolean referencesSessionSchema()(Code) | | Return true if the query node for this statement references SESSION schema tables.
true if references SESSION schema tables, else false |
upToDate | boolean upToDate() throws StandardException(Code) | | Checks whether this PreparedStatement is up to date.
A PreparedStatement can become out of date if any of several
things happen:
A schema used by the statement is dropped
A table used by the statement is dropped
A table used by the statement, or a column in such a table,
is altered in one of several ways: a column is dropped,
a privilege is dropped, a constraint is added or
dropped, an index is dropped.
A view used by the statement is dropped.
In general, anything that happened since the plan was generated
that might cause the plan to fail, or to generate incorrect results,
will cause this method to return FALSE.
TRUE if the PreparedStatement is up to date,FALSE if it is not up to date |
|
|