Top Description Methods
org.apache.derby.iapi.sql.execute

public Interface ExecPreparedStatement

extends PreparedStatement
Known Direct Subinterfaces
org.apache.derby.iapi.sql.StorablePreparedStatement
Known Direct Implementers
org.apache.derby.impl.sql.GenericPreparedStatement
Imports
org.apache.derby.iapi.services.loader.GeneratedClass, org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.sql.conn.LanguageConnectionContext, org.apache.derby.iapi.sql.PreparedStatement, java.util.List, org.apache.derby.iapi.sql.dictionary.StatementPermission

Execution extends prepared statement to add methods it needs for execution purposes (that should not be on the Database API).

Method Summary

Modifier and TypeMethod and Description
public 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.

public GeneratedClass
getActivationClass()

Get the class generated for this prepared statement.

public ExecPreparedStatement

Returns:

a new prepared statement
getClone
()

Get a new prepared statement that is a shallow copy of the current one.

public ConstantAction

Returns:

ConstantAction The big structure enclosing the Execution constants.
getConstantAction
()

Get the Execution constants.

public Object

Returns:

Object the cursor info
getCursorInfo
()

Get the saved cursor info.

public long

Returns:

the row count from the first execution of the result set
getInitialRowCount
(int
the result set to get the initial row count for
rsNum
,
long
the current row count for the result set
currentRowCount
)

Get the initial row count of the specified result set.

public List<StatementPermission>

Returns:

the list of permissions required to execute this statement. May be null if the database does not use SQL standard authorization
getRequiredPermissionsList
()

public Object

Returns:

Object A saved object. The caller has to know what it is requesting and cast it back to the expected type.
getSavedObject
(int objectNum)

Get a saved object by number.

public List<Object>

Returns:

a list with all the saved objects
getSavedObjects
()

Get all the saved objects.

public int

Returns:

the stale plan check interval, or zero if it has not been initialized yet
getStalePlanCheckInterval
()

Get the stale plan check interval.

public ExecCursorTableReference

Returns:

target table of the cursor
getTargetTable
()

the target table of the cursor

public int

Returns:

The update mode of the cursor
getUpdateMode
()

the update mode of the cursor

public boolean
hasUpdateColumns()

Check if this prepared statement has a cursor with columns that can be updated.

public int

Returns:

execution count for this statement after the last compilation
incrementExecutionCount
()

Increment and return the execution count for this statement.

public boolean
isUpdateColumn(String columnName)

Check if the specified column name is one of the update columns.

public boolean

Returns:

true if needs a savepoint
needsSavepoint
()

Does this statement need a savpoint

public void
setSource(String
the source text
txt
)

set the statement text

public void
setSPSAction()

Indicate that the statement represents an SPS action

public void
setStalePlanCheckInterval(int
the stale plan check interval
interval
)

Set the stale plan check interval.

public void
setValid()

set this prepared statement to be valid

public boolean

Returns:

true if this statement is up to date and its activation class is identical to gc, false otherwise
upToDate
(GeneratedClass
a generated class that must be identical to getActivationClass() for this method to return true
gc
)

Checks whether this PreparedStatement is up to date and its activation class is identical to the supplied generated class.

Inherited from org.apache.derby.iapi.sql.PreparedStatement:
executeexecuteSubStatementexecuteSubStatementgetActivationgetBeginCompileTimestampgetBindTimeInMillisgetCompileTimeInMillisgetCompileTimeWarningsgetEndCompileTimestampgetGenerateTimeInMillisgetOptimizeTimeInMillisgetParameterTypegetParameterTypesgetParseTimeInMillisgetResultDescriptiongetSourcegetSPSNamegetVersionCounterisAtomicreferencesSessionSchemarePrepareupToDate

Method Detail

finishback to summary
public 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.

getActivationClassback to summary
public GeneratedClass getActivationClass() throws StandardException

Get the class generated for this prepared statement. Used to confirm compatability with auxilary structures.

Exceptions
StandardException:
on error obtaining class (probably when a stored prepared statement is loading)
getCloneback to summary
public ExecPreparedStatement getClone() throws StandardException

Get a new prepared statement that is a shallow copy of the current one.

Returns:ExecPreparedStatement

a new prepared statement

Exceptions
StandardException:
on error
getConstantActionback to summary
public ConstantAction getConstantAction()

Get the Execution constants. This routine is called at Execution time.

Returns:ConstantAction

ConstantAction The big structure enclosing the Execution constants.

getCursorInfoback to summary
public Object getCursorInfo()

Get the saved cursor info. Used for stored prepared statements.

Returns:Object

Object the cursor info

getInitialRowCountback to summary
public 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:int

the result set to get the initial row count for

currentRowCount:long

the current row count for the result set

Returns:long

the row count from the first execution of the result set

getRequiredPermissionsListback to summary
public List<StatementPermission> getRequiredPermissionsList()
Returns:List<StatementPermission>

the list of permissions required to execute this statement. May be null if the database does not use SQL standard authorization

getSavedObjectback to summary
public 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

Object A saved object. The caller has to know what it is requesting and cast it back to the expected type.

getSavedObjectsback to summary
public List<Object> getSavedObjects()

Get all the saved objects. Used for stored prepared statements.

Returns:List<Object>

a list with all the saved objects

getStalePlanCheckIntervalback to summary
public int getStalePlanCheckInterval()

Get the stale plan check interval.

Returns:int

the stale plan check interval, or zero if it has not been initialized yet

getTargetTableback to summary
public ExecCursorTableReference getTargetTable()

the target table of the cursor

Returns:ExecCursorTableReference

target table of the cursor

getUpdateModeback to summary
public int getUpdateMode()

the update mode of the cursor

Returns:int

The update mode of the cursor

hasUpdateColumnsback to summary
public boolean hasUpdateColumns()

Check if this prepared statement has a cursor with columns that can be updated.

incrementExecutionCountback to summary
public int incrementExecutionCount()

Increment and return the execution count for this statement.

Returns:int

execution count for this statement after the last compilation

isUpdateColumnback to summary
public boolean isUpdateColumn(String columnName)

Check if the specified column name is one of the update columns.

needsSavepointback to summary
public boolean needsSavepoint()

Does this statement need a savpoint

Returns:boolean

true if needs a savepoint

setSourceback to summary
public void setSource(String txt)

set the statement text

Parameters
txt:String

the source text

setSPSActionback to summary
public void setSPSAction()

Indicate that the statement represents an SPS action

setStalePlanCheckIntervalback to summary
public void setStalePlanCheckInterval(int interval)

Set the stale plan check interval.

Parameters
interval:int

the stale plan check interval

setValidback to summary
public void setValid()

set this prepared statement to be valid

upToDateback to summary
public 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:GeneratedClass

a generated class that must be identical to getActivationClass() for this method to return true

Returns:boolean

true if this statement is up to date and its activation class is identical to gc, false otherwise

See Also
PreparedStatement#upToDate(), getActivationClass()