public class Statement extends java.lang.Object implements java.sql.Statement, StatementCallbackInterface
| Modifier and Type | Field and Description |
|---|---|
(package private) Agent |
agent_ |
int |
autoGeneratedKeys_ |
(package private) java.util.ArrayList<java.lang.Object> |
batch_ |
Cursor |
cachedCursor_ |
Cursor |
cachedSingletonRowData_ |
private boolean |
closeOnCompletion_ |
private boolean |
closingResultSets_ |
(package private) Connection |
connection_ |
java.lang.String |
cursorAttributesToSendOnPrepare_ |
(package private) java.lang.String |
cursorName_ |
protected boolean |
doWriteTimeout |
(package private) static int |
executeMethod__ |
(package private) static int |
executeQueryMethod__ |
(package private) static int |
executeUpdateMethod__ |
int |
fetchDirection_ |
static long |
fetchedRowBase
For use in debugging setLargeMaxRows() method added by JDBC 4.2
|
int |
fetchSize_ |
int[] |
generatedKeysColumnIndexes_ |
java.lang.String[] |
generatedKeysColumnNames_ |
ResultSet |
generatedKeysResultSet_ |
protected int |
indexOfCurrentResultSet_ |
private static int |
INSIDE_BRACKETED_COMMENT |
private static int |
INSIDE_SIMPLECOMMENT |
(package private) boolean |
isAutoCommittableStatement_ |
(package private) static int |
isCall__ |
(package private) boolean |
isCatalogQuery_ |
static int |
isCommitSql__ |
(package private) static int |
isDeleteSql__ |
(package private) static int |
isInsertSql__ |
protected boolean |
isPoolable |
(package private) static int |
isPositionedUpdateDeleteSql__ |
(package private) boolean |
isPreparedStatement_ |
(package private) static int |
isQuery__ |
static int |
isRollbackSql__ |
(package private) static int |
isUpdate__ |
(package private) static int |
isUpdateSql__ |
MaterialStatement |
materialStatement_ |
(package private) int |
maxFieldSize_ |
(package private) long |
maxRows_ |
int |
numInvisibleRS_ |
(package private) boolean |
openOnClient_ |
(package private) boolean |
openOnServer_ |
private static int |
OUTSIDE
State constants used by the FSM inside getStatementToken.
|
private java.sql.Statement |
owner
The owner of this statement, if any.
|
PreparedStatement |
preparedStatementForAutoGeneratedKeys_ |
(package private) ResultSet |
resultSet_ |
int |
resultSetConcurrency_ |
int |
resultSetHoldability_ |
(package private) ResultSet[] |
resultSetList_ |
(package private) ColumnMetaData |
resultSetMetaData_ |
int |
resultSetType_ |
(package private) int |
returnValueFromProcedure_ |
Section |
section_ |
private Section |
setSpecialRegisterSection_
This variable keeps track of a Section dediacted to
writeSpecialRegister.
|
Cursor |
singletonRowData_ |
protected int |
sqlMode_ |
(package private) int |
sqlUpdateMode_ |
(package private) int |
timeout_ |
protected static java.lang.String |
TIMEOUT_STATEMENT |
protected java.util.ArrayList<java.lang.String> |
timeoutArrayList |
(package private) long |
updateCount_ |
private SqlWarning |
warnings_ |
| Modifier | Constructor and Description |
|---|---|
private |
Statement() |
|
Statement(Agent agent,
Connection connection) |
|
Statement(Agent agent,
Connection connection,
int type,
int concurrency,
int holdability,
int autoGeneratedKeys,
java.lang.String[] columnNames,
int[] columnIndexes) |
| Modifier and Type | Method and Description |
|---|---|
void |
accumulateWarning(SqlWarning e) |
void |
addBatch(java.lang.String sql) |
(package private) java.lang.String |
cacheCursorAttributesToSendOnPrepare() |
void |
cancel() |
(package private) void |
checkAutoGeneratedKeysParameters() |
(package private) void |
checkForAppropriateSqlMode(int executeType,
int sqlMode) |
(package private) void |
checkForClosedStatement() |
protected void |
checkForDuplicateCursorName() |
(package private) void |
checkForInvalidBatchedSql(java.lang.String sql) |
protected void |
checkForStoredProcResultSetCount(int executeType)
Checks that a stored procedure returns the correct number of
result sets given its execute type.
|
private void |
checkResultSetCount(int executeType)
Checks that the number of result sets returned by the statement
is consistent with the executed type.
|
void |
clearBatch() |
void |
clearWarnings() |
(package private) void |
clearWarningsX() |
void |
close() |
private void |
closeEverythingExceptResultSets(boolean removeListener)
Close all resources except for ResultSets.
|
(package private) void |
closeMeOnCompletion() |
void |
closeOnCompletion() |
void |
closeX()
An untraced version of
close. |
void |
completeExecute(Sqlca sqlca) |
void |
completeExecuteCall(Sqlca sqlca,
Cursor singletonParams) |
void |
completeExecuteCall(Sqlca sqlca,
Cursor singletonParams,
ResultSet[] resultSets) |
void |
completeExecuteCallOpenQuery(Sqlca sqlca,
ResultSet resultSet,
ColumnMetaData resultSetMetaData,
Section generatedSection) |
void |
completeExecuteImmediate(Sqlca sqlca) |
void |
completeExecuteSetStatement(Sqlca sqlca) |
void |
completeLocalCommit(java.util.Iterator listenerIterator) |
void |
completeLocalRollback(java.util.Iterator listenerIterator) |
void |
completeOpenQuery(Sqlca sqlca,
ResultSet resultSet) |
void |
completePrepare(Sqlca sqlca) |
void |
completePrepareDescribeOutput(ColumnMetaData resultSetMetaData,
Sqlca sqlca) |
int |
completeSqlca(Sqlca sqlca) |
(package private) java.lang.String |
escape(java.lang.String sql) |
boolean |
execute(java.lang.String sql) |
boolean |
execute(java.lang.String sql,
int autoGeneratedKeys) |
boolean |
execute(java.lang.String sql,
int[] columnIndexes) |
boolean |
execute(java.lang.String sql,
java.lang.String[] columnNames) |
int[] |
executeBatch() |
private long[] |
executeBatchX() |
long[] |
executeLargeBatch() |
long |
executeLargeUpdate(java.lang.String sql) |
long |
executeLargeUpdate(java.lang.String sql,
int autoGeneratedKeys) |
long |
executeLargeUpdate(java.lang.String sql,
int[] columnIndexes) |
long |
executeLargeUpdate(java.lang.String sql,
java.lang.String[] columnNames) |
java.sql.ResultSet |
executeQuery(java.lang.String sql) |
private ResultSet |
executeQueryX(java.lang.String sql) |
int |
executeUpdate(java.lang.String sql) |
int |
executeUpdate(java.lang.String sql,
int autoGeneratedKeys) |
int |
executeUpdate(java.lang.String sql,
int[] columnIndexes) |
int |
executeUpdate(java.lang.String sql,
java.lang.String[] columnNames) |
private long |
executeUpdateX(java.lang.String sql) |
(package private) boolean |
executeX(java.lang.String sql) |
(package private) java.lang.String[] |
extractCursorNameFromWhereCurrentOf(java.lang.String sql) |
protected void |
finalize() |
private void |
flowClose() |
private void |
flowCloseOutsideUOW() |
private void |
flowCloseRetrievedResultSets() |
private void |
flowCloseRetrievedResultSetsOutsideUOW() |
private void |
flowExecute(int executeType,
java.lang.String sql) |
(package private) void |
flowExecuteBatch(long[] updateCounts) |
java.sql.Connection |
getConnection() |
ConnectionCallbackInterface |
getConnectionCallbackInterface() |
int |
getFetchDirection() |
int |
getFetchSize() |
java.sql.ResultSet |
getGeneratedKeys() |
ColumnMetaData |
getGuessedResultSetMetaData() |
protected java.lang.String |
getJdbcStatementInterfaceName()
Returns the name of the java.sql interface implemented by this class.
|
long |
getLargeMaxRows() |
long |
getLargeUpdateCount() |
int |
getMaxFieldSize() |
int |
getMaxRows() |
boolean |
getMoreResults() |
boolean |
getMoreResults(int current) |
private boolean |
getMoreResultsX(int current) |
(package private) java.sql.Statement |
getOwner()
Returns the owner of this statement, if any.
|
(package private) void |
getPreparedStatementForAutoGeneratedKeys() |
(package private) java.lang.String |
getProcedureName(java.lang.String sql) |
int |
getQueryTimeout() |
java.sql.ResultSet |
getResultSet() |
int |
getResultSetConcurrency() |
int |
getResultSetHoldability() |
int |
getResultSetType() |
protected SqlWarning |
getSqlWarnings() |
private java.lang.String |
getStatementToken(java.lang.String sql)
Step past any initial non-significant characters and comments to find
first significant SQL token so we can classify statement.
|
int |
getUpdateCount() |
java.sql.SQLWarning |
getWarnings() |
protected void |
initResetPreparedStatement() |
private void |
initResetStatement() |
private void |
initStatement() |
private void |
initStatement(Agent agent,
Connection connection) |
private void |
initStatement(int type,
int concurrency,
int holdability,
int autoGeneratedKeys,
java.lang.String[] columnNames,
int[] columnIndexes) |
boolean |
isClosed()
Tell whether the statement has been closed or not.
|
boolean |
isCloseOnCompletion() |
private java.lang.String |
isolateAnyInitialIdentifier(java.lang.String sql)
Minion of getStatementToken.
|
private boolean |
isOpen(ResultSet rs) |
boolean |
isPoolable()
Returns the value of the poolable hint, indicating whether
pooling is requested.
|
boolean |
isQueryMode() |
boolean |
isWrapperFor(java.lang.Class<?> iface)
Returns false unless
iface is implemented |
protected java.sql.SQLException |
jdbc3FeatureNotSupported() |
protected java.sql.SQLException |
jdbc3FeatureNotSupported(boolean checkStatement) |
void |
listenToUnitOfWork() |
(package private) void |
mapCursorNameToResultSet() |
void |
markAutoCommitted()
Mark all ResultSets associated with this statement as auto-committed.
|
(package private) void |
markClosed()
This method cleans up client-side resources held by this Statement.
|
(package private) void |
markClosed(boolean removeListener)
This method cleans up client-side resources held by this Statement.
|
(package private) void |
markClosedOnServer() |
private void |
markPrepared() |
(package private) void |
markPreparedStatementForAutoGeneratedKeysClosed() |
(package private) void |
markResultSetsClosed()
Mark all ResultSets associated with this statement as
closed.
|
(package private) void |
markResultSetsClosed(boolean removeListener)
Mark all ResultSets associated with this statement as
closed.
|
(package private) void |
parseSqlAndSetSqlModes(java.lang.String sql) |
(package private) void |
parseStorProcReturnedScrollableRowset() |
private void |
parseUpdateSql(java.lang.String firstToken) |
(package private) void |
prepareAutoGeneratedKeysStatement() |
(package private) void |
readClose(boolean allowAutoCommits) |
(package private) void |
readCloseResultSets(boolean allowAutoCommits) |
(package private) void |
readCloseResultSets(int number,
boolean allowAutoCommits) |
void |
readExecuteCall() |
void |
readExecuteImmediate() |
void |
readExecuteImmediateForBatch(java.lang.String sql) |
void |
readOpenQuery() |
void |
readPrepare() |
(package private) void |
readPrepareAutoGeneratedKeysStatement() |
void |
readPrepareDescribeOutput() |
void |
readSetSpecialRegister() |
protected void |
removeClientCursorNameFromCache() |
void |
reset(boolean fullReset) |
(package private) void |
resetCursorNameAndRemoveFromWhereCurrentOfMappings() |
(package private) void |
resetForReuse()
Resets the statement for reuse in a statement pool.
|
private void |
resetStatement() |
void |
resetStatement(Agent agent,
Connection connection) |
void |
resetStatement(Agent agent,
Connection connection,
int type,
int concurrency,
int holdability,
int autoGeneratedKeys,
java.lang.String[] columnNames,
int[] columnIndexes) |
private void |
resetUserControllableAttributes()
Resets attributes that can be modified by the user through the
Statement interface to default values. |
void |
resultSetCommitting(ResultSet closingRS)
Convenience method for resultSetCommitting(ResultSet, boolean)
|
boolean |
resultSetCommitting(ResultSet closingRS,
boolean writeChain)
Method that checks to see if any other ResultSets are open.
|
void |
setCursorName(java.lang.String name) |
void |
setEscapeProcessing(boolean enable) |
void |
setFetchDirection(int direction) |
void |
setFetchSize(int rows) |
void |
setLargeMaxRows(long maxRows) |
void |
setMaxFieldSize(int max) |
void |
setMaxRows(int maxRows) |
protected void |
setOwner(java.sql.Statement owner)
Designates the owner of this statement, typically a logical statement.
|
void |
setPoolable(boolean poolable)
Requests that a Statement be pooled or not.
|
void |
setQueryTimeout(int seconds) |
protected void |
setupCursorNameCacheAndMappings() |
void |
setUpdateCount(long updateCount) |
protected java.lang.String |
substituteClientCursorNameWithServerCursorName(java.lang.String sql,
Section section) |
<T> T |
unwrap(java.lang.Class<T> iface)
Returns
this if this class implements the specified interface. |
static java.lang.String |
upperCaseProcedureName(java.lang.String procedureName) |
private boolean |
willTickleServer(int number,
boolean allowAutoCommits) |
(package private) void |
writeClose(boolean allowAutoCommits) |
(package private) boolean |
writeCloseResultSets(boolean allowAutoCommits) |
(package private) boolean |
writeCloseResultSets(int number,
boolean allowAutoCommits) |
void |
writeExecuteCall(boolean outputExpected,
java.lang.String procedureName,
Section section,
int fetchSize,
boolean suppressResultSets,
int resultSetType,
ColumnMetaData parameterMetaData,
java.lang.Object[] inputs) |
private Section |
writeExecuteCall(java.lang.String sql,
boolean isBatch) |
void |
writeExecuteImmediate(java.lang.String sql,
Section section) |
void |
writeOpenQuery(Section section,
int fetchSize,
int resultSetType) |
void |
writePrepare(java.lang.String sql,
Section section) |
void |
writePrepareDescribeOutput(java.lang.String sql,
Section section) |
void |
writeSetSpecialRegister(java.util.ArrayList sqlsttList) |
public static long fetchedRowBase
public MaterialStatement materialStatement_
Connection connection_
public Section section_
Agent agent_
private java.sql.Statement owner
ResultSet resultSet_
long updateCount_
int returnValueFromProcedure_
static final int executeQueryMethod__
static final int executeUpdateMethod__
static final int executeMethod__
protected int sqlMode_
static final int isQuery__
static final int isCall__
static final int isUpdate__
int sqlUpdateMode_
public static final int isCommitSql__
public static final int isRollbackSql__
static final int isPositionedUpdateDeleteSql__
static final int isInsertSql__
static final int isDeleteSql__
static final int isUpdateSql__
ColumnMetaData resultSetMetaData_
public Cursor cachedCursor_
public Cursor cachedSingletonRowData_
boolean isPreparedStatement_
java.lang.String cursorName_
boolean openOnClient_
boolean openOnServer_
protected int indexOfCurrentResultSet_
ResultSet[] resultSetList_
protected static final java.lang.String TIMEOUT_STATEMENT
protected java.util.ArrayList<java.lang.String> timeoutArrayList
protected boolean doWriteTimeout
int timeout_
long maxRows_
int maxFieldSize_
boolean isAutoCommittableStatement_
boolean isCatalogQuery_
final java.util.ArrayList<java.lang.Object> batch_
public int resultSetType_
public int resultSetConcurrency_
public int resultSetHoldability_
public int fetchSize_
public int fetchDirection_
public Cursor singletonRowData_
public int numInvisibleRS_
public java.lang.String cursorAttributesToSendOnPrepare_
public PreparedStatement preparedStatementForAutoGeneratedKeys_
public ResultSet generatedKeysResultSet_
public java.lang.String[] generatedKeysColumnNames_
public int[] generatedKeysColumnIndexes_
public int autoGeneratedKeys_
private SqlWarning warnings_
protected boolean isPoolable
private boolean closeOnCompletion_
private boolean closingResultSets_
private Section setSpecialRegisterSection_
private static final int OUTSIDE
private static final int INSIDE_SIMPLECOMMENT
private static final int INSIDE_BRACKETED_COMMENT
private Statement()
public Statement(Agent agent, Connection connection) throws SqlException
SqlExceptionpublic Statement(Agent agent, Connection connection, int type, int concurrency, int holdability, int autoGeneratedKeys, java.lang.String[] columnNames, int[] columnIndexes) throws SqlException
SqlExceptionprivate void resetStatement()
private void initStatement()
private void initResetStatement()
protected void initResetPreparedStatement()
private void resetUserControllableAttributes()
Statement interface to default values.public void reset(boolean fullReset)
throws SqlException
SqlExceptionvoid resetForReuse()
throws SqlException
Intended to be used only by prepared or callable statements, as
Statement objects aren't pooled.
The following actions are taken:
SqlException - if resetting the statement failspublic void resetStatement(Agent agent, Connection connection) throws SqlException
SqlExceptionprivate void initStatement(Agent agent, Connection connection)
public void resetStatement(Agent agent, Connection connection, int type, int concurrency, int holdability, int autoGeneratedKeys, java.lang.String[] columnNames, int[] columnIndexes) throws SqlException
SqlExceptionprivate void initStatement(int type,
int concurrency,
int holdability,
int autoGeneratedKeys,
java.lang.String[] columnNames,
int[] columnIndexes)
throws SqlException
SqlExceptionprotected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwableprotected SqlWarning getSqlWarnings()
public java.sql.ResultSet executeQuery(java.lang.String sql)
throws java.sql.SQLException
executeQuery in interface java.sql.Statementjava.sql.SQLExceptionprivate ResultSet executeQueryX(java.lang.String sql) throws SqlException
SqlExceptionpublic int executeUpdate(java.lang.String sql)
throws java.sql.SQLException
executeUpdate in interface java.sql.Statementjava.sql.SQLExceptionpublic long executeLargeUpdate(java.lang.String sql)
throws java.sql.SQLException
executeLargeUpdate in interface java.sql.Statementjava.sql.SQLExceptionprivate long executeUpdateX(java.lang.String sql)
throws SqlException
SqlExceptionpublic boolean isWrapperFor(java.lang.Class<?> iface)
throws java.sql.SQLException
iface is implementedisWrapperFor in interface java.sql.Wrapperiface - a Class defining an interface.java.sql.SQLException - if an error occurs while determining
whether this is a wrapper for an object
with the given interface.public <T> T unwrap(java.lang.Class<T> iface)
throws java.sql.SQLException
this if this class implements the specified interface.unwrap in interface java.sql.Wrapperiface - a class defining an interfacejava.sql.SQLException - if no object is found that implements the
interfacepublic boolean isClosed()
throws java.sql.SQLException
isClosed in interface java.sql.Statementtrue if closed, false otherwise.java.sql.SQLException - if a database access error occurs (according to
spec). Never thrown by this implementation.public void close()
throws java.sql.SQLException
close in interface java.lang.AutoCloseableclose in interface java.sql.Statementjava.sql.SQLExceptionpublic void closeX()
throws SqlException
close. This method cleans up
client-side resources and also sends commands to network server to
perform clean up. This should not be called in the finalizer.
Difference between finalize and close is
that close method does these things additionally (Changes done as
part of DERBY-210):
1) Sends commands to the server to close the result sets.
2) Sends commands to the server to close the result sets of the
generated keys query.
3) Sends a commit if autocommit is on and it is appropriate.
4) Explicitly removes the statement from connection_.openStatements_
and CommitAndRollbackListeners_ by passing true to markClosed.
We may need to do 1) in finalizer too. This is being tracked in
DERBY-1021SqlExceptionpublic boolean isPoolable()
throws java.sql.SQLException
isPoolable in interface java.sql.Statementjava.sql.SQLException - if the Statement has been closed.public void setPoolable(boolean poolable)
throws java.sql.SQLException
setPoolable in interface java.sql.Statementpoolable - requests that the Statement be pooled if true
and not be pooled if false.java.sql.SQLException - if the Statement has been closed.public int getMaxFieldSize()
throws java.sql.SQLException
getMaxFieldSize in interface java.sql.Statementjava.sql.SQLExceptionpublic void setMaxFieldSize(int max)
throws java.sql.SQLException
setMaxFieldSize in interface java.sql.Statementjava.sql.SQLExceptionpublic int getMaxRows()
throws java.sql.SQLException
getMaxRows in interface java.sql.Statementjava.sql.SQLExceptionpublic long getLargeMaxRows()
throws java.sql.SQLException
getLargeMaxRows in interface java.sql.Statementjava.sql.SQLExceptionpublic void setMaxRows(int maxRows)
throws java.sql.SQLException
setMaxRows in interface java.sql.Statementjava.sql.SQLExceptionpublic void setLargeMaxRows(long maxRows)
throws java.sql.SQLException
setLargeMaxRows in interface java.sql.Statementjava.sql.SQLExceptionpublic void setEscapeProcessing(boolean enable)
throws java.sql.SQLException
setEscapeProcessing in interface java.sql.Statementjava.sql.SQLExceptionpublic int getQueryTimeout()
throws java.sql.SQLException
getQueryTimeout in interface java.sql.Statementjava.sql.SQLExceptionpublic void setQueryTimeout(int seconds)
throws java.sql.SQLException
setQueryTimeout in interface java.sql.Statementjava.sql.SQLExceptionpublic void cancel()
throws java.sql.SQLException
cancel in interface java.sql.Statementjava.sql.SQLExceptionpublic java.sql.SQLWarning getWarnings()
throws java.sql.SQLException
getWarnings in interface java.sql.Statementjava.sql.SQLExceptionpublic void clearWarnings()
throws java.sql.SQLException
clearWarnings in interface java.sql.Statementjava.sql.SQLExceptionfinal void clearWarningsX()
public void setCursorName(java.lang.String name)
throws java.sql.SQLException
setCursorName in interface java.sql.Statementjava.sql.SQLExceptionpublic boolean execute(java.lang.String sql)
throws java.sql.SQLException
execute in interface java.sql.Statementjava.sql.SQLExceptionboolean executeX(java.lang.String sql)
throws SqlException
SqlExceptionpublic java.sql.ResultSet getResultSet()
throws java.sql.SQLException
getResultSet in interface java.sql.Statementjava.sql.SQLExceptionpublic int getUpdateCount()
throws java.sql.SQLException
getUpdateCount in interface java.sql.Statementjava.sql.SQLExceptionpublic long getLargeUpdateCount()
throws java.sql.SQLException
getLargeUpdateCount in interface java.sql.Statementjava.sql.SQLExceptionpublic boolean getMoreResults()
throws java.sql.SQLException
getMoreResults in interface java.sql.Statementjava.sql.SQLExceptionpublic void setFetchDirection(int direction)
throws java.sql.SQLException
setFetchDirection in interface java.sql.Statementjava.sql.SQLExceptionpublic int getFetchDirection()
throws java.sql.SQLException
getFetchDirection in interface java.sql.Statementjava.sql.SQLExceptionpublic void setFetchSize(int rows)
throws java.sql.SQLException
setFetchSize in interface java.sql.Statementjava.sql.SQLExceptionpublic int getFetchSize()
throws java.sql.SQLException
getFetchSize in interface java.sql.Statementjava.sql.SQLExceptionpublic int getResultSetConcurrency()
throws java.sql.SQLException
getResultSetConcurrency in interface java.sql.Statementjava.sql.SQLExceptionpublic int getResultSetType()
throws java.sql.SQLException
getResultSetType in interface java.sql.Statementjava.sql.SQLExceptionpublic void addBatch(java.lang.String sql)
throws java.sql.SQLException
addBatch in interface java.sql.Statementjava.sql.SQLExceptionpublic void clearBatch()
throws java.sql.SQLException
clearBatch in interface java.sql.Statementjava.sql.SQLExceptionpublic int[] executeBatch()
throws java.sql.SQLException
executeBatch in interface java.sql.Statementjava.sql.SQLExceptionpublic long[] executeLargeBatch()
throws java.sql.SQLException
executeLargeBatch in interface java.sql.Statementjava.sql.SQLExceptionprivate long[] executeBatchX()
throws SqlException,
java.sql.BatchUpdateException
SqlExceptionjava.sql.BatchUpdateExceptionpublic java.sql.Connection getConnection()
throws java.sql.SQLException
getConnection in interface java.sql.Statementjava.sql.SQLExceptionpublic boolean getMoreResults(int current)
throws java.sql.SQLException
getMoreResults in interface java.sql.Statementjava.sql.SQLExceptionprivate boolean getMoreResultsX(int current)
throws SqlException
SqlExceptionpublic java.sql.ResultSet getGeneratedKeys()
throws java.sql.SQLException
getGeneratedKeys in interface java.sql.Statementjava.sql.SQLExceptionpublic int executeUpdate(java.lang.String sql,
int autoGeneratedKeys)
throws java.sql.SQLException
executeUpdate in interface java.sql.Statementjava.sql.SQLExceptionpublic long executeLargeUpdate(java.lang.String sql,
int autoGeneratedKeys)
throws java.sql.SQLException
executeLargeUpdate in interface java.sql.Statementjava.sql.SQLExceptionpublic int executeUpdate(java.lang.String sql,
int[] columnIndexes)
throws java.sql.SQLException
executeUpdate in interface java.sql.Statementjava.sql.SQLExceptionpublic long executeLargeUpdate(java.lang.String sql,
int[] columnIndexes)
throws java.sql.SQLException
executeLargeUpdate in interface java.sql.Statementjava.sql.SQLExceptionpublic int executeUpdate(java.lang.String sql,
java.lang.String[] columnNames)
throws java.sql.SQLException
executeUpdate in interface java.sql.Statementjava.sql.SQLExceptionpublic long executeLargeUpdate(java.lang.String sql,
java.lang.String[] columnNames)
throws java.sql.SQLException
executeLargeUpdate in interface java.sql.Statementjava.sql.SQLExceptionpublic boolean execute(java.lang.String sql,
int autoGeneratedKeys)
throws java.sql.SQLException
execute in interface java.sql.Statementjava.sql.SQLExceptionpublic boolean execute(java.lang.String sql,
int[] columnIndexes)
throws java.sql.SQLException
execute in interface java.sql.Statementjava.sql.SQLExceptionpublic boolean execute(java.lang.String sql,
java.lang.String[] columnNames)
throws java.sql.SQLException
execute in interface java.sql.Statementjava.sql.SQLExceptionpublic int getResultSetHoldability()
throws java.sql.SQLException
getResultSetHoldability in interface java.sql.Statementjava.sql.SQLExceptionpublic void writeSetSpecialRegister(java.util.ArrayList sqlsttList)
throws SqlException
SqlExceptionpublic void readSetSpecialRegister()
throws SqlException
SqlExceptionpublic void writeExecuteImmediate(java.lang.String sql,
Section section)
throws SqlException
SqlExceptionpublic void readExecuteImmediate()
throws SqlException
SqlExceptionpublic void completeExecuteImmediate(Sqlca sqlca)
completeExecuteImmediate in interface StatementCallbackInterfacepublic void readExecuteImmediateForBatch(java.lang.String sql)
throws SqlException
SqlExceptionpublic void writePrepareDescribeOutput(java.lang.String sql,
Section section)
throws SqlException
SqlExceptionpublic void readPrepareDescribeOutput()
throws SqlException
SqlExceptionpublic void completePrepareDescribeOutput(ColumnMetaData resultSetMetaData, Sqlca sqlca)
completePrepareDescribeOutput in interface StatementCallbackInterfacepublic void writePrepare(java.lang.String sql,
Section section)
throws SqlException
SqlExceptionpublic void readPrepare()
throws SqlException
SqlExceptionpublic void completePrepare(Sqlca sqlca)
completePrepare in interface StatementCallbackInterfacepublic void writeOpenQuery(Section section, int fetchSize, int resultSetType) throws SqlException
SqlExceptionpublic void readOpenQuery()
throws SqlException
SqlExceptionpublic void completeOpenQuery(Sqlca sqlca, ResultSet resultSet)
completeOpenQuery in interface StatementCallbackInterfacepublic void completeExecuteCallOpenQuery(Sqlca sqlca, ResultSet resultSet, ColumnMetaData resultSetMetaData, Section generatedSection)
completeExecuteCallOpenQuery in interface StatementCallbackInterfacepublic void writeExecuteCall(boolean outputExpected,
java.lang.String procedureName,
Section section,
int fetchSize,
boolean suppressResultSets,
int resultSetType,
ColumnMetaData parameterMetaData,
java.lang.Object[] inputs)
throws SqlException
SqlExceptionpublic void readExecuteCall()
throws SqlException
SqlExceptionpublic void completeExecuteCall(Sqlca sqlca, Cursor singletonParams, ResultSet[] resultSets)
completeExecuteCall in interface StatementCallbackInterfacepublic void completeExecuteCall(Sqlca sqlca, Cursor singletonParams)
completeExecuteCall in interface StatementCallbackInterfacepublic void completeExecute(Sqlca sqlca)
completeExecute in interface StatementCallbackInterfacepublic void setUpdateCount(long updateCount)
protected final void setOwner(java.sql.Statement owner)
owner - the owning statement, if anyfinal java.sql.Statement getOwner()
null if none.private boolean willTickleServer(int number,
boolean allowAutoCommits)
throws SqlException
SqlExceptionprivate void flowClose()
throws SqlException
SqlExceptionprivate void flowCloseOutsideUOW()
throws SqlException
SqlExceptionfinal void writeClose(boolean allowAutoCommits)
throws SqlException
SqlExceptionfinal void readClose(boolean allowAutoCommits)
throws SqlException
SqlExceptionfinal boolean writeCloseResultSets(boolean allowAutoCommits)
throws SqlException
SqlExceptionboolean writeCloseResultSets(int number,
boolean allowAutoCommits)
throws SqlException
SqlExceptionfinal void readCloseResultSets(boolean allowAutoCommits)
throws SqlException
SqlExceptionvoid readCloseResultSets(int number,
boolean allowAutoCommits)
throws SqlException
SqlExceptionprivate void flowCloseRetrievedResultSets()
throws SqlException
SqlExceptionprivate void flowCloseRetrievedResultSetsOutsideUOW()
throws SqlException
SqlExceptionpublic int completeSqlca(Sqlca sqlca)
completeSqlca in interface StatementCallbackInterfacepublic void completeExecuteSetStatement(Sqlca sqlca)
completeExecuteSetStatement in interface StatementCallbackInterfacevoid markClosedOnServer()
void markClosed()
org.apache.derby.client.am.Connection.
This method is called from:
1. finalize() - For the finaizer to be called, the Statement
should not have any references and so it should have been already
removed from the lists.
2. org.apache.derby.client.am.Connection#markStatementsClosed
This method explicitly removes the Statement from open statements list.
3. To close positioned update statements - These statements are not
added to the list of open statements.void markClosed(boolean removeListener)
removeListener - if true the Statement will be removed
from the open statements list and PreparedStatement will also be removed
from commit and rollback listeners list in
org.apache.derby.client.am.Connection.private void closeEverythingExceptResultSets(boolean removeListener)
void markPreparedStatementForAutoGeneratedKeysClosed()
void markResultSetsClosed()
org.apache.derby.client.am.Connection.final void markResultSetsClosed(boolean removeListener)
removeListener - if true the ResultSets will be removed
from the commit and rollback listeners list in
org.apache.derby.client.am.Connection.private void flowExecute(int executeType,
java.lang.String sql)
throws SqlException
SqlExceptionvoid flowExecuteBatch(long[] updateCounts)
throws SqlException,
java.sql.BatchUpdateException
SqlExceptionjava.sql.BatchUpdateExceptionprivate Section writeExecuteCall(java.lang.String sql, boolean isBatch) throws SqlException
SqlExceptionpublic void listenToUnitOfWork()
listenToUnitOfWork in interface UnitOfWorkListenerpublic void completeLocalCommit(java.util.Iterator listenerIterator)
completeLocalCommit in interface UnitOfWorkListenerpublic void completeLocalRollback(java.util.Iterator listenerIterator)
completeLocalRollback in interface UnitOfWorkListenerpublic void accumulateWarning(SqlWarning e)
accumulateWarning in interface StatementCallbackInterfaceprivate void markPrepared()
protected java.lang.String getJdbcStatementInterfaceName()
void parseSqlAndSetSqlModes(java.lang.String sql)
throws SqlException
SqlExceptionprivate java.lang.String isolateAnyInitialIdentifier(java.lang.String sql)
sql - input stringgetStatementToken(java.lang.String)private java.lang.String getStatementToken(java.lang.String sql)
throws SqlException
SqlException - std exception policyprivate void parseUpdateSql(java.lang.String firstToken)
java.lang.String getProcedureName(java.lang.String sql)
throws SqlException
SqlExceptionpublic static java.lang.String upperCaseProcedureName(java.lang.String procedureName)
throws SqlException
SqlExceptionfinal void checkForAppropriateSqlMode(int executeType,
int sqlMode)
throws SqlException
SqlExceptionprivate void checkResultSetCount(int executeType)
throws SqlException
executeQuery()
should return exactly one result set and executeUpdate()
none. Raises an exception if the result set count does not match the
execute type.executeType - one of executeQueryMethod__,
executeUpdateMethod__ and executeMethod__SqlException - if the number of result sets does not
match the execute typeprotected final void checkForStoredProcResultSetCount(int executeType)
throws SqlException
executeType - one of executeQueryMethod__,
executeUpdateMethod__ and executeMethod__SqlException - if the number of result sets does not
match the execute typecheckResultSetCount(int)final void checkForClosedStatement()
throws SqlException
SqlExceptionvoid checkForInvalidBatchedSql(java.lang.String sql)
throws SqlException
SqlExceptionprotected void checkForDuplicateCursorName()
throws SqlException
SqlExceptionprotected void setupCursorNameCacheAndMappings()
java.lang.String[] extractCursorNameFromWhereCurrentOf(java.lang.String sql)
protected java.lang.String substituteClientCursorNameWithServerCursorName(java.lang.String sql,
Section section)
throws SqlException
SqlExceptionpublic ConnectionCallbackInterface getConnectionCallbackInterface()
getConnectionCallbackInterface in interface StatementCallbackInterfacevoid resetCursorNameAndRemoveFromWhereCurrentOfMappings()
void mapCursorNameToResultSet()
void parseStorProcReturnedScrollableRowset()
throws SqlException
SqlExceptionjava.lang.String escape(java.lang.String sql)
throws SqlException
SqlExceptionjava.lang.String cacheCursorAttributesToSendOnPrepare()
throws SqlException
SqlExceptionvoid getPreparedStatementForAutoGeneratedKeys()
throws SqlException
SqlExceptionvoid prepareAutoGeneratedKeysStatement()
throws SqlException
SqlExceptionvoid readPrepareAutoGeneratedKeysStatement()
throws SqlException
SqlExceptionvoid checkAutoGeneratedKeysParameters()
throws SqlException
SqlExceptionpublic ColumnMetaData getGuessedResultSetMetaData()
getGuessedResultSetMetaData in interface StatementCallbackInterfacepublic boolean isQueryMode()
protected void removeClientCursorNameFromCache()
public void resultSetCommitting(ResultSet closingRS) throws SqlException
closingRS - The ResultSet to be closedSqlExceptionresultSetCommitting(ResultSet, boolean)public boolean resultSetCommitting(ResultSet closingRS, boolean writeChain) throws SqlException
closingRS - The ResultSet to be closedwriteChain - A Boolean indicating whether this method
is part of a chain of write from client to ServerSqlExceptionpublic void markAutoCommitted()
protected java.sql.SQLException jdbc3FeatureNotSupported(boolean checkStatement)
throws java.sql.SQLException
java.sql.SQLExceptionprotected java.sql.SQLException jdbc3FeatureNotSupported()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void closeOnCompletion()
throws java.sql.SQLException
closeOnCompletion in interface java.sql.Statementjava.sql.SQLExceptionpublic boolean isCloseOnCompletion()
throws java.sql.SQLException
isCloseOnCompletion in interface java.sql.Statementjava.sql.SQLExceptionvoid closeMeOnCompletion()
private boolean isOpen(ResultSet rs) throws java.sql.SQLException
java.sql.SQLExceptionApache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.