java.lang.AutoCloseable, java.sql.Statement, java.sql.Wrapper, StatementCallbackInterface, UnitOfWorkListenerClientPreparedStatementpublic class ClientStatement extends java.lang.Object implements java.sql.Statement, StatementCallbackInterface
| Modifier and Type | Field | Description |
|---|---|---|
(package private) Agent |
agent_ |
|
(package private) int |
autoGeneratedKeys_ |
|
(package private) java.util.ArrayList<java.lang.Object> |
batch_ |
|
Cursor |
cachedCursor_ |
|
Cursor |
cachedSingletonRowData_ |
|
private boolean |
closeOnCompletion_ |
|
private boolean |
closingResultSets_ |
|
(package private) ClientConnection |
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__ |
|
(package private) int |
fetchDirection_ |
|
private static long |
fetchedRowBase |
For use in debugging setLargeMaxRows() method added by JDBC 4.2
|
(package private) int |
fetchSize_ |
|
(package private) int[] |
generatedKeysColumnIndexes_ |
|
(package private) java.lang.String[] |
generatedKeysColumnNames_ |
|
(package private) ClientResultSet |
generatedKeysResultSet_ |
|
private 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_ |
|
(package private) static int |
isDeleteSql__ |
|
(package private) static int |
isInsertSql__ |
|
protected boolean |
isPoolable |
|
(package private) boolean |
isPreparedStatement_ |
|
(package private) static int |
isQuery__ |
|
(package private) static int |
isUpdate__ |
|
(package private) static int |
isUpdateSql__ |
|
private MaterialStatement |
materialStatement_ |
|
(package private) int |
maxFieldSize_ |
|
(package private) long |
maxRows_ |
|
(package private) boolean |
openOnClient_ |
|
private static int |
OUTSIDE |
State constants used by the FSM inside getStatementToken.
|
private java.sql.Statement |
owner |
The owner of this statement, if any.
|
(package private) ClientPreparedStatement |
preparedStatementForAutoGeneratedKeys_ |
|
(package private) ClientResultSet |
resultSet_ |
|
int |
resultSetConcurrency_ |
|
(package private) int |
resultSetHoldability_ |
|
(package private) ClientResultSet[] |
resultSetList_ |
|
(package private) ColumnMetaData |
resultSetMetaData_ |
|
int |
resultSetType_ |
|
private Section |
section_ |
|
private Section |
setSpecialRegisterSection_ |
This variable keeps track of a Section dediacted to
writeSpecialRegister.
|
(package private) 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 | Description |
|---|---|---|
private |
ClientStatement() |
|
|
ClientStatement(Agent agent,
ClientConnection connection) |
|
|
ClientStatement(Agent agent,
ClientConnection connection,
int type,
int concurrency,
int holdability,
int autoGeneratedKeys,
java.lang.String[] columnNames,
int[] columnIndexes) |
| Modifier and Type | Method | 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() |
|
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() |
|
(package private) void |
closeX() |
An untraced version of
close. |
void |
completeExecute(Sqlca sqlca) |
|
void |
completeExecuteCall(Sqlca sqlca,
Cursor singletonParams) |
|
void |
completeExecuteCall(Sqlca sqlca,
Cursor singletonParams,
ClientResultSet[] resultSets) |
|
void |
completeExecuteCallOpenQuery(Sqlca sqlca,
ClientResultSet 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,
ClientResultSet 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 ClientResultSet |
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) |
|
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() |
|
MaterialStatement |
getMaterialStatement() |
|
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.
|
int |
getQueryTimeout() |
|
java.sql.ResultSet |
getResultSet() |
|
int |
getResultSetConcurrency() |
|
int |
getResultSetHoldability() |
|
int |
getResultSetType() |
|
Section |
getSection() |
Provides public access for section_.
|
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(int type,
int concurrency,
int holdability,
int autoGeneratedKeys,
java.lang.String[] columnNames,
int[] columnIndexes) |
|
private void |
initStatement(Agent agent,
ClientConnection connection) |
|
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(ClientResultSet 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 |
void |
listenToUnitOfWork() |
|
private void |
mapCursorNameToResultSet() |
|
private 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.
|
private void |
markPrepared() |
|
private void |
markPreparedStatementForAutoGeneratedKeysClosed() |
|
(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) |
|
protected static ClientPreparedStatement |
prepareAutoGeneratedKeysStatement(ClientConnection cc) |
|
(package private) void |
readClose(boolean allowAutoCommits) |
|
(package private) void |
readCloseResultSets(boolean allowAutoCommits) |
|
private void |
readCloseResultSets(int number,
boolean allowAutoCommits) |
|
(package private) void |
readExecuteCall() |
|
private void |
readExecuteImmediate() |
|
private void |
readExecuteImmediateForBatch(java.lang.String sql) |
|
(package private) void |
readOpenQuery() |
|
(package private) void |
readPrepare() |
|
(package private) void |
readPrepareDescribeOutput() |
|
(package private) 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.
|
(package private) void |
resetResultSetList() |
|
private void |
resetStatement() |
|
(package private) void |
resetStatement(Agent agent,
ClientConnection connection) |
|
void |
resetStatement(Agent agent,
ClientConnection 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. |
(package private) void |
resultSetCommitting(ClientResultSet closingRS) |
Convenience method for resultSetCommitting(ClientResultSet, boolean)
|
(package private) boolean |
resultSetCommitting(ClientResultSet 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) |
|
static void |
setFetchedRowBase(long newBase) |
Debug method used to test the setLargeMaxRows() method added by JDBC 4.2.
|
void |
setFetchSize(int rows) |
|
void |
setLargeMaxRows(long maxRows) |
|
void |
setMaterialStatement(MaterialStatement materialStatement) |
|
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 |
setSection(Section s) |
Assigns a new value (even null) to section_.
|
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. |
private boolean |
willTickleServer(int number,
boolean allowAutoCommits) |
|
(package private) void |
writeClose(boolean allowAutoCommits) |
|
(package private) boolean |
writeCloseResultSets(boolean allowAutoCommits) |
The connection close processing passes allowAutoCommits=false
because if we drove an auto-commits after each statement close,
then when we issue close requests on non-held cursors the
server would complain that the non-held cursor was already
closed from the previous statement's auto-commit.
|
private boolean |
writeCloseResultSets(int number,
boolean allowAutoCommits) |
|
(package private) 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) |
|
private void |
writeExecuteImmediate(java.lang.String sql,
Section section) |
|
(package private) void |
writeOpenQuery(Section section,
int fetchSize,
int resultSetType) |
|
(package private) void |
writePrepare(java.lang.String sql,
Section section) |
|
(package private) void |
writePrepareDescribeOutput(java.lang.String sql,
Section section) |
|
(package private) void |
writeSetSpecialRegister(java.util.ArrayList sqlsttList) |
private static long fetchedRowBase
private MaterialStatement materialStatement_
ClientConnection connection_
private Section section_
Agent agent_
private java.sql.Statement owner
ClientResultSet resultSet_
long updateCount_
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_
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_
private int indexOfCurrentResultSet_
ClientResultSet[] 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_
int resultSetHoldability_
int fetchSize_
int fetchDirection_
Cursor singletonRowData_
public java.lang.String cursorAttributesToSendOnPrepare_
ClientPreparedStatement preparedStatementForAutoGeneratedKeys_
ClientResultSet generatedKeysResultSet_
java.lang.String[] generatedKeysColumnNames_
int[] generatedKeysColumnIndexes_
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 ClientStatement()
public ClientStatement(Agent agent, ClientConnection connection) throws SqlException
SqlExceptionpublic ClientStatement(Agent agent, ClientConnection connection, int type, int concurrency, int holdability, int autoGeneratedKeys, java.lang.String[] columnNames, int[] columnIndexes) throws SqlException
SqlExceptionpublic static void setFetchedRowBase(long newBase)
public MaterialStatement getMaterialStatement()
public void setMaterialStatement(MaterialStatement materialStatement)
materialStatement - the materialStatement to setprivate 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 failsvoid resetStatement(Agent agent, ClientConnection connection) throws SqlException
SqlExceptionprivate void initStatement(Agent agent, ClientConnection connection)
public void resetStatement(Agent agent, ClientConnection 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 ClientResultSet 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.SQLExceptionvoid 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.SQLExceptionvoid writeSetSpecialRegister(java.util.ArrayList sqlsttList)
throws SqlException
SqlExceptionvoid readSetSpecialRegister()
throws SqlException
SqlExceptionprivate void writeExecuteImmediate(java.lang.String sql,
Section section)
throws SqlException
SqlExceptionprivate void readExecuteImmediate()
throws SqlException
SqlExceptionpublic void completeExecuteImmediate(Sqlca sqlca)
completeExecuteImmediate in interface StatementCallbackInterfaceprivate void readExecuteImmediateForBatch(java.lang.String sql)
throws SqlException
SqlExceptionvoid writePrepareDescribeOutput(java.lang.String sql,
Section section)
throws SqlException
SqlExceptionvoid readPrepareDescribeOutput()
throws SqlException
SqlExceptionpublic void completePrepareDescribeOutput(ColumnMetaData resultSetMetaData, Sqlca sqlca)
completePrepareDescribeOutput in interface StatementCallbackInterfacevoid writePrepare(java.lang.String sql,
Section section)
throws SqlException
SqlExceptionvoid readPrepare()
throws SqlException
SqlExceptionpublic void completePrepare(Sqlca sqlca)
completePrepare in interface StatementCallbackInterfacevoid writeOpenQuery(Section section, int fetchSize, int resultSetType) throws SqlException
SqlExceptionvoid readOpenQuery()
throws SqlException
SqlExceptionpublic void completeOpenQuery(Sqlca sqlca, ClientResultSet resultSet)
completeOpenQuery in interface StatementCallbackInterfacepublic void completeExecuteCallOpenQuery(Sqlca sqlca, ClientResultSet resultSet, ColumnMetaData resultSetMetaData, Section generatedSection)
completeExecuteCallOpenQuery in interface StatementCallbackInterfacevoid writeExecuteCall(boolean outputExpected,
java.lang.String procedureName,
Section section,
int fetchSize,
boolean suppressResultSets,
int resultSetType,
ColumnMetaData parameterMetaData,
java.lang.Object[] inputs)
throws SqlException
SqlExceptionvoid readExecuteCall()
throws SqlException
SqlExceptionpublic void completeExecuteCall(Sqlca sqlca, Cursor singletonParams, ClientResultSet[] 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
allowAutoCommits - SqlExceptionprivate boolean writeCloseResultSets(int number,
boolean allowAutoCommits)
throws SqlException
SqlExceptionfinal void readCloseResultSets(boolean allowAutoCommits)
throws SqlException
SqlExceptionprivate void 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 markClosed()
org.apache.derby.client.am.Connection.
This method is called from:
1. finalize() - For the finalizer 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)
private void markPreparedStatementForAutoGeneratedKeysClosed()
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
SqlExceptionprivate void 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)
final 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
SqlExceptionprivate void 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()
private void mapCursorNameToResultSet()
void parseStorProcReturnedScrollableRowset()
throws SqlException
SqlExceptionjava.lang.String escape(java.lang.String sql)
throws SqlException
SqlExceptionjava.lang.String cacheCursorAttributesToSendOnPrepare()
throws SqlException
SqlExceptionprotected static ClientPreparedStatement prepareAutoGeneratedKeysStatement(ClientConnection cc) throws SqlException
SqlExceptionvoid checkAutoGeneratedKeysParameters()
throws SqlException
SqlExceptionpublic ColumnMetaData getGuessedResultSetMetaData()
getGuessedResultSetMetaData in interface StatementCallbackInterfacepublic boolean isQueryMode()
protected void removeClientCursorNameFromCache()
void resultSetCommitting(ClientResultSet closingRS) throws SqlException
closingRS - The ResultSet to be closedSqlExceptionresultSetCommitting(ClientResultSet, boolean)boolean resultSetCommitting(ClientResultSet 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 ServerSqlExceptionprivate void markAutoCommitted()
public 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(ClientResultSet rs) throws java.sql.SQLException
java.sql.SQLExceptionvoid resetResultSetList()
public Section getSection()
protected void setSection(Section s)
s - the section_ to set.Apache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.