public class ClientStatement extends java.lang.Object implements java.sql.Statement, StatementCallbackInterface
Modifier and Type | Field and 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 and 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 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() |
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(Agent agent,
ClientConnection 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(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
SqlException
public ClientStatement(Agent agent, ClientConnection connection, int type, int concurrency, int holdability, int autoGeneratedKeys, java.lang.String[] columnNames, int[] columnIndexes) throws SqlException
SqlException
public 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
SqlException
void 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
SqlException
private 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
SqlException
private void initStatement(int type, int concurrency, int holdability, int autoGeneratedKeys, java.lang.String[] columnNames, int[] columnIndexes) throws SqlException
SqlException
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
protected SqlWarning getSqlWarnings()
public java.sql.ResultSet executeQuery(java.lang.String sql) throws java.sql.SQLException
executeQuery
in interface java.sql.Statement
java.sql.SQLException
private ClientResultSet executeQueryX(java.lang.String sql) throws SqlException
SqlException
public int executeUpdate(java.lang.String sql) throws java.sql.SQLException
executeUpdate
in interface java.sql.Statement
java.sql.SQLException
public long executeLargeUpdate(java.lang.String sql) throws java.sql.SQLException
executeLargeUpdate
in interface java.sql.Statement
java.sql.SQLException
private long executeUpdateX(java.lang.String sql) throws SqlException
SqlException
public boolean isWrapperFor(java.lang.Class<?> iface) throws java.sql.SQLException
iface
is implementedisWrapperFor
in interface java.sql.Wrapper
iface
- 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.Wrapper
iface
- 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.Statement
true
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.AutoCloseable
close
in interface java.sql.Statement
java.sql.SQLException
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-1021SqlException
public boolean isPoolable() throws java.sql.SQLException
isPoolable
in interface java.sql.Statement
java.sql.SQLException
- if the Statement has been closed.public void setPoolable(boolean poolable) throws java.sql.SQLException
setPoolable
in interface java.sql.Statement
poolable
- 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.Statement
java.sql.SQLException
public void setMaxFieldSize(int max) throws java.sql.SQLException
setMaxFieldSize
in interface java.sql.Statement
java.sql.SQLException
public int getMaxRows() throws java.sql.SQLException
getMaxRows
in interface java.sql.Statement
java.sql.SQLException
public long getLargeMaxRows() throws java.sql.SQLException
getLargeMaxRows
in interface java.sql.Statement
java.sql.SQLException
public void setMaxRows(int maxRows) throws java.sql.SQLException
setMaxRows
in interface java.sql.Statement
java.sql.SQLException
public void setLargeMaxRows(long maxRows) throws java.sql.SQLException
setLargeMaxRows
in interface java.sql.Statement
java.sql.SQLException
public void setEscapeProcessing(boolean enable) throws java.sql.SQLException
setEscapeProcessing
in interface java.sql.Statement
java.sql.SQLException
public int getQueryTimeout() throws java.sql.SQLException
getQueryTimeout
in interface java.sql.Statement
java.sql.SQLException
public void setQueryTimeout(int seconds) throws java.sql.SQLException
setQueryTimeout
in interface java.sql.Statement
java.sql.SQLException
public void cancel() throws java.sql.SQLException
cancel
in interface java.sql.Statement
java.sql.SQLException
public java.sql.SQLWarning getWarnings() throws java.sql.SQLException
getWarnings
in interface java.sql.Statement
java.sql.SQLException
public void clearWarnings() throws java.sql.SQLException
clearWarnings
in interface java.sql.Statement
java.sql.SQLException
final void clearWarningsX()
public void setCursorName(java.lang.String name) throws java.sql.SQLException
setCursorName
in interface java.sql.Statement
java.sql.SQLException
public boolean execute(java.lang.String sql) throws java.sql.SQLException
execute
in interface java.sql.Statement
java.sql.SQLException
boolean executeX(java.lang.String sql) throws SqlException
SqlException
public java.sql.ResultSet getResultSet() throws java.sql.SQLException
getResultSet
in interface java.sql.Statement
java.sql.SQLException
public int getUpdateCount() throws java.sql.SQLException
getUpdateCount
in interface java.sql.Statement
java.sql.SQLException
public long getLargeUpdateCount() throws java.sql.SQLException
getLargeUpdateCount
in interface java.sql.Statement
java.sql.SQLException
public boolean getMoreResults() throws java.sql.SQLException
getMoreResults
in interface java.sql.Statement
java.sql.SQLException
public void setFetchDirection(int direction) throws java.sql.SQLException
setFetchDirection
in interface java.sql.Statement
java.sql.SQLException
public int getFetchDirection() throws java.sql.SQLException
getFetchDirection
in interface java.sql.Statement
java.sql.SQLException
public void setFetchSize(int rows) throws java.sql.SQLException
setFetchSize
in interface java.sql.Statement
java.sql.SQLException
public int getFetchSize() throws java.sql.SQLException
getFetchSize
in interface java.sql.Statement
java.sql.SQLException
public int getResultSetConcurrency() throws java.sql.SQLException
getResultSetConcurrency
in interface java.sql.Statement
java.sql.SQLException
public int getResultSetType() throws java.sql.SQLException
getResultSetType
in interface java.sql.Statement
java.sql.SQLException
public void addBatch(java.lang.String sql) throws java.sql.SQLException
addBatch
in interface java.sql.Statement
java.sql.SQLException
public void clearBatch() throws java.sql.SQLException
clearBatch
in interface java.sql.Statement
java.sql.SQLException
public int[] executeBatch() throws java.sql.SQLException
executeBatch
in interface java.sql.Statement
java.sql.SQLException
public long[] executeLargeBatch() throws java.sql.SQLException
executeLargeBatch
in interface java.sql.Statement
java.sql.SQLException
private long[] executeBatchX() throws SqlException, java.sql.BatchUpdateException
SqlException
java.sql.BatchUpdateException
public java.sql.Connection getConnection() throws java.sql.SQLException
getConnection
in interface java.sql.Statement
java.sql.SQLException
public boolean getMoreResults(int current) throws java.sql.SQLException
getMoreResults
in interface java.sql.Statement
java.sql.SQLException
private boolean getMoreResultsX(int current) throws SqlException
SqlException
public java.sql.ResultSet getGeneratedKeys() throws java.sql.SQLException
getGeneratedKeys
in interface java.sql.Statement
java.sql.SQLException
public int executeUpdate(java.lang.String sql, int autoGeneratedKeys) throws java.sql.SQLException
executeUpdate
in interface java.sql.Statement
java.sql.SQLException
public long executeLargeUpdate(java.lang.String sql, int autoGeneratedKeys) throws java.sql.SQLException
executeLargeUpdate
in interface java.sql.Statement
java.sql.SQLException
public int executeUpdate(java.lang.String sql, int[] columnIndexes) throws java.sql.SQLException
executeUpdate
in interface java.sql.Statement
java.sql.SQLException
public long executeLargeUpdate(java.lang.String sql, int[] columnIndexes) throws java.sql.SQLException
executeLargeUpdate
in interface java.sql.Statement
java.sql.SQLException
public int executeUpdate(java.lang.String sql, java.lang.String[] columnNames) throws java.sql.SQLException
executeUpdate
in interface java.sql.Statement
java.sql.SQLException
public long executeLargeUpdate(java.lang.String sql, java.lang.String[] columnNames) throws java.sql.SQLException
executeLargeUpdate
in interface java.sql.Statement
java.sql.SQLException
public boolean execute(java.lang.String sql, int autoGeneratedKeys) throws java.sql.SQLException
execute
in interface java.sql.Statement
java.sql.SQLException
public boolean execute(java.lang.String sql, int[] columnIndexes) throws java.sql.SQLException
execute
in interface java.sql.Statement
java.sql.SQLException
public boolean execute(java.lang.String sql, java.lang.String[] columnNames) throws java.sql.SQLException
execute
in interface java.sql.Statement
java.sql.SQLException
public int getResultSetHoldability() throws java.sql.SQLException
getResultSetHoldability
in interface java.sql.Statement
java.sql.SQLException
void writeSetSpecialRegister(java.util.ArrayList sqlsttList) throws SqlException
SqlException
void readSetSpecialRegister() throws SqlException
SqlException
private void writeExecuteImmediate(java.lang.String sql, Section section) throws SqlException
SqlException
private void readExecuteImmediate() throws SqlException
SqlException
public void completeExecuteImmediate(Sqlca sqlca)
completeExecuteImmediate
in interface StatementCallbackInterface
private void readExecuteImmediateForBatch(java.lang.String sql) throws SqlException
SqlException
void writePrepareDescribeOutput(java.lang.String sql, Section section) throws SqlException
SqlException
void readPrepareDescribeOutput() throws SqlException
SqlException
public void completePrepareDescribeOutput(ColumnMetaData resultSetMetaData, Sqlca sqlca)
completePrepareDescribeOutput
in interface StatementCallbackInterface
void writePrepare(java.lang.String sql, Section section) throws SqlException
SqlException
void readPrepare() throws SqlException
SqlException
public void completePrepare(Sqlca sqlca)
completePrepare
in interface StatementCallbackInterface
void writeOpenQuery(Section section, int fetchSize, int resultSetType) throws SqlException
SqlException
void readOpenQuery() throws SqlException
SqlException
public void completeOpenQuery(Sqlca sqlca, ClientResultSet resultSet)
completeOpenQuery
in interface StatementCallbackInterface
public void completeExecuteCallOpenQuery(Sqlca sqlca, ClientResultSet resultSet, ColumnMetaData resultSetMetaData, Section generatedSection)
completeExecuteCallOpenQuery
in interface StatementCallbackInterface
void writeExecuteCall(boolean outputExpected, java.lang.String procedureName, Section section, int fetchSize, boolean suppressResultSets, int resultSetType, ColumnMetaData parameterMetaData, java.lang.Object[] inputs) throws SqlException
SqlException
void readExecuteCall() throws SqlException
SqlException
public void completeExecuteCall(Sqlca sqlca, Cursor singletonParams, ClientResultSet[] resultSets)
completeExecuteCall
in interface StatementCallbackInterface
public void completeExecuteCall(Sqlca sqlca, Cursor singletonParams)
completeExecuteCall
in interface StatementCallbackInterface
public void completeExecute(Sqlca sqlca)
completeExecute
in interface StatementCallbackInterface
public 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
SqlException
private void flowClose() throws SqlException
SqlException
private void flowCloseOutsideUOW() throws SqlException
SqlException
final void writeClose(boolean allowAutoCommits) throws SqlException
SqlException
final void readClose(boolean allowAutoCommits) throws SqlException
SqlException
final boolean writeCloseResultSets(boolean allowAutoCommits) throws SqlException
allowAutoCommits
- SqlException
private boolean writeCloseResultSets(int number, boolean allowAutoCommits) throws SqlException
SqlException
final void readCloseResultSets(boolean allowAutoCommits) throws SqlException
SqlException
private void readCloseResultSets(int number, boolean allowAutoCommits) throws SqlException
SqlException
private void flowCloseRetrievedResultSets() throws SqlException
SqlException
private void flowCloseRetrievedResultSetsOutsideUOW() throws SqlException
SqlException
public int completeSqlca(Sqlca sqlca)
completeSqlca
in interface StatementCallbackInterface
public void completeExecuteSetStatement(Sqlca sqlca)
completeExecuteSetStatement
in interface StatementCallbackInterface
void 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
SqlException
private void flowExecuteBatch(long[] updateCounts) throws SqlException, java.sql.BatchUpdateException
SqlException
java.sql.BatchUpdateException
private Section writeExecuteCall(java.lang.String sql, boolean isBatch) throws SqlException
SqlException
public void listenToUnitOfWork()
listenToUnitOfWork
in interface UnitOfWorkListener
public void completeLocalCommit(java.util.Iterator listenerIterator)
completeLocalCommit
in interface UnitOfWorkListener
public void completeLocalRollback(java.util.Iterator listenerIterator)
completeLocalRollback
in interface UnitOfWorkListener
public void accumulateWarning(SqlWarning e)
accumulateWarning
in interface StatementCallbackInterface
private void markPrepared()
protected java.lang.String getJdbcStatementInterfaceName()
void parseSqlAndSetSqlModes(java.lang.String sql) throws SqlException
SqlException
private 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
SqlException
private 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
SqlException
private void checkForInvalidBatchedSql(java.lang.String sql) throws SqlException
SqlException
protected void checkForDuplicateCursorName() throws SqlException
SqlException
protected void setupCursorNameCacheAndMappings()
java.lang.String[] extractCursorNameFromWhereCurrentOf(java.lang.String sql)
protected java.lang.String substituteClientCursorNameWithServerCursorName(java.lang.String sql, Section section) throws SqlException
SqlException
public ConnectionCallbackInterface getConnectionCallbackInterface()
getConnectionCallbackInterface
in interface StatementCallbackInterface
void resetCursorNameAndRemoveFromWhereCurrentOfMappings()
private void mapCursorNameToResultSet()
void parseStorProcReturnedScrollableRowset() throws SqlException
SqlException
java.lang.String escape(java.lang.String sql) throws SqlException
SqlException
java.lang.String cacheCursorAttributesToSendOnPrepare() throws SqlException
SqlException
protected static ClientPreparedStatement prepareAutoGeneratedKeysStatement(ClientConnection cc) throws SqlException
SqlException
void checkAutoGeneratedKeysParameters() throws SqlException
SqlException
public ColumnMetaData getGuessedResultSetMetaData()
getGuessedResultSetMetaData
in interface StatementCallbackInterface
public boolean isQueryMode()
protected void removeClientCursorNameFromCache()
void resultSetCommitting(ClientResultSet closingRS) throws SqlException
closingRS
- The ResultSet to be closedSqlException
resultSetCommitting(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 ServerSqlException
private void markAutoCommitted()
public void closeOnCompletion() throws java.sql.SQLException
closeOnCompletion
in interface java.sql.Statement
java.sql.SQLException
public boolean isCloseOnCompletion() throws java.sql.SQLException
isCloseOnCompletion
in interface java.sql.Statement
java.sql.SQLException
void closeMeOnCompletion()
private boolean isOpen(ClientResultSet rs) throws java.sql.SQLException
java.sql.SQLException
void resetResultSetList()
public Section getSection()
protected void setSection(Section s)
s
- the section_ to set.Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.