org.apache.derby.client.am
Class ClientStatement
- java.lang.Object
-
- org.apache.derby.client.am.ClientStatement
-
- All Implemented Interfaces:
- java.lang.AutoCloseable, java.sql.Statement, java.sql.Wrapper, StatementCallbackInterface, UnitOfWorkListener
- Direct Known Subclasses:
- ClientPreparedStatement
public class ClientStatement extends java.lang.Object implements java.sql.Statement, StatementCallbackInterface
-
-
Field Summary
Fields Modifier and Type Field and Description CursorcachedCursor_CursorcachedSingletonRowData_java.lang.StringcursorAttributesToSendOnPrepare_intresultSetConcurrency_intresultSetType_
-
Constructor Summary
Constructors Constructor and Description ClientStatement(Agent agent, ClientConnection connection)ClientStatement(Agent agent, ClientConnection connection, int type, int concurrency, int holdability, int autoGeneratedKeys, java.lang.String[] columnNames, int[] columnIndexes)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaccumulateWarning(SqlWarning e)voidaddBatch(java.lang.String sql)voidcancel()voidclearBatch()voidclearWarnings()voidclose()voidcloseOnCompletion()voidcompleteExecute(Sqlca sqlca)voidcompleteExecuteCall(Sqlca sqlca, Cursor singletonParams)voidcompleteExecuteCall(Sqlca sqlca, Cursor singletonParams, ClientResultSet[] resultSets)voidcompleteExecuteCallOpenQuery(Sqlca sqlca, ClientResultSet resultSet, ColumnMetaData resultSetMetaData, Section generatedSection)voidcompleteExecuteImmediate(Sqlca sqlca)voidcompleteExecuteSetStatement(Sqlca sqlca)voidcompleteLocalCommit(java.util.Iterator listenerIterator)voidcompleteLocalRollback(java.util.Iterator listenerIterator)voidcompleteOpenQuery(Sqlca sqlca, ClientResultSet resultSet)voidcompletePrepare(Sqlca sqlca)voidcompletePrepareDescribeOutput(ColumnMetaData resultSetMetaData, Sqlca sqlca)intcompleteSqlca(Sqlca sqlca)booleanexecute(java.lang.String sql)booleanexecute(java.lang.String sql, int autoGeneratedKeys)booleanexecute(java.lang.String sql, int[] columnIndexes)booleanexecute(java.lang.String sql, java.lang.String[] columnNames)int[]executeBatch()long[]executeLargeBatch()longexecuteLargeUpdate(java.lang.String sql)longexecuteLargeUpdate(java.lang.String sql, int autoGeneratedKeys)longexecuteLargeUpdate(java.lang.String sql, int[] columnIndexes)longexecuteLargeUpdate(java.lang.String sql, java.lang.String[] columnNames)java.sql.ResultSetexecuteQuery(java.lang.String sql)intexecuteUpdate(java.lang.String sql)intexecuteUpdate(java.lang.String sql, int autoGeneratedKeys)intexecuteUpdate(java.lang.String sql, int[] columnIndexes)intexecuteUpdate(java.lang.String sql, java.lang.String[] columnNames)java.sql.ConnectiongetConnection()ConnectionCallbackInterfacegetConnectionCallbackInterface()intgetFetchDirection()intgetFetchSize()java.sql.ResultSetgetGeneratedKeys()ColumnMetaDatagetGuessedResultSetMetaData()longgetLargeMaxRows()longgetLargeUpdateCount()MaterialStatementgetMaterialStatement()intgetMaxFieldSize()intgetMaxRows()booleangetMoreResults()booleangetMoreResults(int current)intgetQueryTimeout()java.sql.ResultSetgetResultSet()intgetResultSetConcurrency()intgetResultSetHoldability()intgetResultSetType()SectiongetSection()Provides public access for section_.intgetUpdateCount()java.sql.SQLWarninggetWarnings()booleanisClosed()Tell whether the statement has been closed or not.booleanisCloseOnCompletion()booleanisPoolable()Returns the value of the poolable hint, indicating whether pooling is requested.booleanisQueryMode()booleanisWrapperFor(java.lang.Class<?> iface)Returns false unlessifaceis implementedvoidlistenToUnitOfWork()voidreset(boolean fullReset)voidresetStatement(Agent agent, ClientConnection connection, int type, int concurrency, int holdability, int autoGeneratedKeys, java.lang.String[] columnNames, int[] columnIndexes)voidsetCursorName(java.lang.String name)voidsetEscapeProcessing(boolean enable)voidsetFetchDirection(int direction)static voidsetFetchedRowBase(long newBase)Debug method used to test the setLargeMaxRows() method added by JDBC 4.2.voidsetFetchSize(int rows)voidsetLargeMaxRows(long maxRows)voidsetMaterialStatement(MaterialStatement materialStatement)voidsetMaxFieldSize(int max)voidsetMaxRows(int maxRows)voidsetPoolable(boolean poolable)Requests that a Statement be pooled or not.voidsetQueryTimeout(int seconds)voidsetUpdateCount(long updateCount)<T> Tunwrap(java.lang.Class<T> iface)Returnsthisif this class implements the specified interface.
-
-
-
Field Detail
-
cachedCursor_
public Cursor cachedCursor_
-
cachedSingletonRowData_
public Cursor cachedSingletonRowData_
-
resultSetType_
public int resultSetType_
-
resultSetConcurrency_
public int resultSetConcurrency_
-
cursorAttributesToSendOnPrepare_
public java.lang.String cursorAttributesToSendOnPrepare_
-
-
Constructor Detail
-
ClientStatement
public ClientStatement(Agent agent, ClientConnection connection) throws SqlException
- Throws:
SqlException
-
ClientStatement
public ClientStatement(Agent agent, ClientConnection connection, int type, int concurrency, int holdability, int autoGeneratedKeys, java.lang.String[] columnNames, int[] columnIndexes) throws SqlException
- Throws:
SqlException
-
-
Method Detail
-
setFetchedRowBase
public static void setFetchedRowBase(long newBase)
Debug method used to test the setLargeMaxRows() method added by JDBC 4.2. This method is a NOP on a production (insane) build of Derby.
-
getMaterialStatement
public MaterialStatement getMaterialStatement()
- Returns:
- the materialStatement
-
setMaterialStatement
public void setMaterialStatement(MaterialStatement materialStatement)
- Parameters:
materialStatement- the materialStatement to set
-
reset
public void reset(boolean fullReset) throws SqlException- Throws:
SqlException
-
resetStatement
public void resetStatement(Agent agent, ClientConnection connection, int type, int concurrency, int holdability, int autoGeneratedKeys, java.lang.String[] columnNames, int[] columnIndexes) throws SqlException
- Throws:
SqlException
-
executeQuery
public java.sql.ResultSet executeQuery(java.lang.String sql) throws java.sql.SQLException- Specified by:
executeQueryin interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
executeUpdate
public int executeUpdate(java.lang.String sql) throws java.sql.SQLException- Specified by:
executeUpdatein interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
executeLargeUpdate
public long executeLargeUpdate(java.lang.String sql) throws java.sql.SQLException- Specified by:
executeLargeUpdatein interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
isWrapperFor
public boolean isWrapperFor(java.lang.Class<?> iface) throws java.sql.SQLExceptionReturns false unlessifaceis implemented- Specified by:
isWrapperForin interfacejava.sql.Wrapper- Parameters:
iface- a Class defining an interface.- Returns:
- true if this implements the interface or directly or indirectly wraps an object that does.
- Throws:
java.sql.SQLException- if an error occurs while determining whether this is a wrapper for an object with the given interface.
-
unwrap
public <T> T unwrap(java.lang.Class<T> iface) throws java.sql.SQLExceptionReturnsthisif this class implements the specified interface.- Specified by:
unwrapin interfacejava.sql.Wrapper- Parameters:
iface- a class defining an interface- Returns:
- an object that implements the interface
- Throws:
java.sql.SQLException- if no object is found that implements the interface
-
isClosed
public boolean isClosed() throws java.sql.SQLExceptionTell whether the statement has been closed or not.- Specified by:
isClosedin interfacejava.sql.Statement- Returns:
trueif closed,falseotherwise.- Throws:
java.sql.SQLException- if a database access error occurs (according to spec). Never thrown by this implementation.
-
close
public void close() throws java.sql.SQLException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
isPoolable
public boolean isPoolable() throws java.sql.SQLExceptionReturns the value of the poolable hint, indicating whether pooling is requested.- Specified by:
isPoolablein interfacejava.sql.Statement- Returns:
- The value of the poolable hint.
- Throws:
java.sql.SQLException- if the Statement has been closed.
-
setPoolable
public void setPoolable(boolean poolable) throws java.sql.SQLExceptionRequests that a Statement be pooled or not.- Specified by:
setPoolablein interfacejava.sql.Statement- Parameters:
poolable- requests that the Statement be pooled if true and not be pooled if false.- Throws:
java.sql.SQLException- if the Statement has been closed.
-
getMaxFieldSize
public int getMaxFieldSize() throws java.sql.SQLException- Specified by:
getMaxFieldSizein interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
setMaxFieldSize
public void setMaxFieldSize(int max) throws java.sql.SQLException- Specified by:
setMaxFieldSizein interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
getMaxRows
public int getMaxRows() throws java.sql.SQLException- Specified by:
getMaxRowsin interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
getLargeMaxRows
public long getLargeMaxRows() throws java.sql.SQLException- Specified by:
getLargeMaxRowsin interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
setMaxRows
public void setMaxRows(int maxRows) throws java.sql.SQLException- Specified by:
setMaxRowsin interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
setLargeMaxRows
public void setLargeMaxRows(long maxRows) throws java.sql.SQLException- Specified by:
setLargeMaxRowsin interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
setEscapeProcessing
public void setEscapeProcessing(boolean enable) throws java.sql.SQLException- Specified by:
setEscapeProcessingin interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
getQueryTimeout
public int getQueryTimeout() throws java.sql.SQLException- Specified by:
getQueryTimeoutin interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
setQueryTimeout
public void setQueryTimeout(int seconds) throws java.sql.SQLException- Specified by:
setQueryTimeoutin interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
cancel
public void cancel() throws java.sql.SQLException- Specified by:
cancelin interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
getWarnings
public java.sql.SQLWarning getWarnings() throws java.sql.SQLException- Specified by:
getWarningsin interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
clearWarnings
public void clearWarnings() throws java.sql.SQLException- Specified by:
clearWarningsin interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
setCursorName
public void setCursorName(java.lang.String name) throws java.sql.SQLException- Specified by:
setCursorNamein interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
execute
public boolean execute(java.lang.String sql) throws java.sql.SQLException- Specified by:
executein interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
getResultSet
public java.sql.ResultSet getResultSet() throws java.sql.SQLException- Specified by:
getResultSetin interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
getUpdateCount
public int getUpdateCount() throws java.sql.SQLException- Specified by:
getUpdateCountin interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
getLargeUpdateCount
public long getLargeUpdateCount() throws java.sql.SQLException- Specified by:
getLargeUpdateCountin interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
getMoreResults
public boolean getMoreResults() throws java.sql.SQLException- Specified by:
getMoreResultsin interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
setFetchDirection
public void setFetchDirection(int direction) throws java.sql.SQLException- Specified by:
setFetchDirectionin interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
getFetchDirection
public int getFetchDirection() throws java.sql.SQLException- Specified by:
getFetchDirectionin interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
setFetchSize
public void setFetchSize(int rows) throws java.sql.SQLException- Specified by:
setFetchSizein interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
getFetchSize
public int getFetchSize() throws java.sql.SQLException- Specified by:
getFetchSizein interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
getResultSetConcurrency
public int getResultSetConcurrency() throws java.sql.SQLException- Specified by:
getResultSetConcurrencyin interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
getResultSetType
public int getResultSetType() throws java.sql.SQLException- Specified by:
getResultSetTypein interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
addBatch
public void addBatch(java.lang.String sql) throws java.sql.SQLException- Specified by:
addBatchin interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
clearBatch
public void clearBatch() throws java.sql.SQLException- Specified by:
clearBatchin interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
executeBatch
public int[] executeBatch() throws java.sql.SQLException- Specified by:
executeBatchin interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
executeLargeBatch
public long[] executeLargeBatch() throws java.sql.SQLException- Specified by:
executeLargeBatchin interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
getConnection
public java.sql.Connection getConnection() throws java.sql.SQLException- Specified by:
getConnectionin interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
getMoreResults
public boolean getMoreResults(int current) throws java.sql.SQLException- Specified by:
getMoreResultsin interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
getGeneratedKeys
public java.sql.ResultSet getGeneratedKeys() throws java.sql.SQLException- Specified by:
getGeneratedKeysin interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
executeUpdate
public int executeUpdate(java.lang.String sql, int autoGeneratedKeys) throws java.sql.SQLException- Specified by:
executeUpdatein interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
executeLargeUpdate
public long executeLargeUpdate(java.lang.String sql, int autoGeneratedKeys) throws java.sql.SQLException- Specified by:
executeLargeUpdatein interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
executeUpdate
public int executeUpdate(java.lang.String sql, int[] columnIndexes) throws java.sql.SQLException- Specified by:
executeUpdatein interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
executeLargeUpdate
public long executeLargeUpdate(java.lang.String sql, int[] columnIndexes) throws java.sql.SQLException- Specified by:
executeLargeUpdatein interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
executeUpdate
public int executeUpdate(java.lang.String sql, java.lang.String[] columnNames) throws java.sql.SQLException- Specified by:
executeUpdatein interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
executeLargeUpdate
public long executeLargeUpdate(java.lang.String sql, java.lang.String[] columnNames) throws java.sql.SQLException- Specified by:
executeLargeUpdatein interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
execute
public boolean execute(java.lang.String sql, int autoGeneratedKeys) throws java.sql.SQLException- Specified by:
executein interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
execute
public boolean execute(java.lang.String sql, int[] columnIndexes) throws java.sql.SQLException- Specified by:
executein interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
execute
public boolean execute(java.lang.String sql, java.lang.String[] columnNames) throws java.sql.SQLException- Specified by:
executein interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
getResultSetHoldability
public int getResultSetHoldability() throws java.sql.SQLException- Specified by:
getResultSetHoldabilityin interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
completeExecuteImmediate
public void completeExecuteImmediate(Sqlca sqlca)
- Specified by:
completeExecuteImmediatein interfaceStatementCallbackInterface
-
completePrepareDescribeOutput
public void completePrepareDescribeOutput(ColumnMetaData resultSetMetaData, Sqlca sqlca)
- Specified by:
completePrepareDescribeOutputin interfaceStatementCallbackInterface
-
completePrepare
public void completePrepare(Sqlca sqlca)
- Specified by:
completePreparein interfaceStatementCallbackInterface
-
completeOpenQuery
public void completeOpenQuery(Sqlca sqlca, ClientResultSet resultSet)
- Specified by:
completeOpenQueryin interfaceStatementCallbackInterface
-
completeExecuteCallOpenQuery
public void completeExecuteCallOpenQuery(Sqlca sqlca, ClientResultSet resultSet, ColumnMetaData resultSetMetaData, Section generatedSection)
- Specified by:
completeExecuteCallOpenQueryin interfaceStatementCallbackInterface
-
completeExecuteCall
public void completeExecuteCall(Sqlca sqlca, Cursor singletonParams, ClientResultSet[] resultSets)
- Specified by:
completeExecuteCallin interfaceStatementCallbackInterface
-
completeExecuteCall
public void completeExecuteCall(Sqlca sqlca, Cursor singletonParams)
- Specified by:
completeExecuteCallin interfaceStatementCallbackInterface
-
completeExecute
public void completeExecute(Sqlca sqlca)
- Specified by:
completeExecutein interfaceStatementCallbackInterface
-
setUpdateCount
public void setUpdateCount(long updateCount)
-
completeSqlca
public int completeSqlca(Sqlca sqlca)
- Specified by:
completeSqlcain interfaceStatementCallbackInterface
-
completeExecuteSetStatement
public void completeExecuteSetStatement(Sqlca sqlca)
- Specified by:
completeExecuteSetStatementin interfaceStatementCallbackInterface
-
listenToUnitOfWork
public void listenToUnitOfWork()
- Specified by:
listenToUnitOfWorkin interfaceUnitOfWorkListener
-
completeLocalCommit
public void completeLocalCommit(java.util.Iterator listenerIterator)
- Specified by:
completeLocalCommitin interfaceUnitOfWorkListener
-
completeLocalRollback
public void completeLocalRollback(java.util.Iterator listenerIterator)
- Specified by:
completeLocalRollbackin interfaceUnitOfWorkListener
-
accumulateWarning
public void accumulateWarning(SqlWarning e)
- Specified by:
accumulateWarningin interfaceStatementCallbackInterface
-
getConnectionCallbackInterface
public ConnectionCallbackInterface getConnectionCallbackInterface()
- Specified by:
getConnectionCallbackInterfacein interfaceStatementCallbackInterface
-
getGuessedResultSetMetaData
public ColumnMetaData getGuessedResultSetMetaData()
- Specified by:
getGuessedResultSetMetaDatain interfaceStatementCallbackInterface
-
isQueryMode
public boolean isQueryMode()
-
closeOnCompletion
public void closeOnCompletion() throws java.sql.SQLException- Specified by:
closeOnCompletionin interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
isCloseOnCompletion
public boolean isCloseOnCompletion() throws java.sql.SQLException- Specified by:
isCloseOnCompletionin interfacejava.sql.Statement- Throws:
java.sql.SQLException
-
getSection
public Section getSection()
Provides public access for section_. This is necessary as the section concept is shared between client.am and net. Seems like it really belongs in net as it is tied to the particular protocol used.- Returns:
- section_
-
-
DataMelt 3.0 © DataMelt by jWork.ORG