Class ClientPreparedStatement
java.lang.Object
org.apache.derby.client.am.ClientStatement
org.apache.derby.client.am.ClientPreparedStatement
- All Implemented Interfaces:
AutoCloseable, PreparedStatement, Statement, Wrapper, PreparedStatementCallbackInterface, StatementCallbackInterface, UnitOfWorkListener
- Direct Known Subclasses:
ClientCallableStatement, ClientPreparedStatement42
public class ClientPreparedStatement
extends ClientStatement
implements PreparedStatement, PreparedStatementCallbackInterface
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classPossibleTypes is information which is set of types. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean(package private) boolean(package private) ColumnMetaData(package private) boolean[](package private) Object[]private boolean[]private ArrayList<int[]> private final ClientPooledConnectionprivate String(package private) StringFields inherited from class ClientStatement
agent_, autoGeneratedKeys_, batch_, cachedCursor_, cachedSingletonRowData_, connection_, cursorAttributesToSendOnPrepare_, cursorName_, doWriteTimeout, executeMethod__, executeQueryMethod__, executeUpdateMethod__, fetchDirection_, fetchSize_, generatedKeysColumnIndexes_, generatedKeysColumnNames_, generatedKeysResultSet_, isAutoCommittableStatement_, isCall__, isCatalogQuery_, isDeleteSql__, isInsertSql__, isPoolable, isPreparedStatement_, isQuery__, isUpdate__, isUpdateSql__, maxFieldSize_, maxRows_, openOnClient_, preparedStatementForAutoGeneratedKeys_, resultSet_, resultSetConcurrency_, resultSetHoldability_, resultSetList_, resultSetMetaData_, resultSetType_, singletonRowData_, sqlMode_, sqlUpdateMode_, timeout_, TIMEOUT_STATEMENT, timeoutArrayList, updateCount_Fields inherited from interface Statement
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO -
Constructor Summary
ConstructorsConstructorDescriptionClientPreparedStatement(Agent agent, ClientConnection connection, String sql, int type, int concurrency, int holdability, int autoGeneratedKeys, String[] columnNames, int[] columnIndexes, ClientPooledConnection cpc) The PreparedStatementConstructor used for jdbc 2 prepared statements with scroll attributes.ClientPreparedStatement(Agent agent, ClientConnection connection, String sql, Section section, ClientPooledConnection cpc) The PreparedStatement constructor used for JDBC 2 positioned update statements. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBatch()void(package private) voidcheckForValidParameterIndex(int parameterIndex) (package private) voidcheckForValidScale(int scale) private voidprotected voidCheck for closed statement and extract the SQLException if it is raised.private voidcheckStreamLength(long length) Check the length passed in for the stream that is to be set.private voidprivate voidcheckTypeForSetAsciiStream(int parameterIndex) private voidcheckTypeForSetBinaryStream(int parameterIndex) private voidcheckTypeForSetBlob(int parameterIndex) private voidcheckTypeForSetCharacterStream(int parameterIndex) private voidcheckTypeForSetClob(int parameterIndex) voidvoidcompleteDescribeInput(ColumnMetaData parameterMetaData, Sqlca sqlca) voidcompleteDescribeOutput(ColumnMetaData resultSetMetaData, Sqlca sqlca) voidcompleteLocalCommit(Iterator listenerIterator) voidcompleteLocalRollback(Iterator listenerIterator) private voidbooleanexecute()booleanbooleanbooleanbooleanint[]private long[]executeBatchRequestX(boolean supportsQueryBatchRequest) private long[]executeBatchX(boolean supportsQueryBatchRequest) longexecuteQuery(String sql) (package private) ClientResultSetintintexecuteUpdate(String sql) intexecuteUpdate(String sql, int autoGeneratedKeys) intexecuteUpdate(String sql, int[] columnIndexes) intexecuteUpdate(String sql, String[] columnNames) private long(package private) booleanexecuteX()private boolean[]expandBooleanArray(boolean[] array, int newLength) private Object[]expandObjectArray(Object[] array, int newLength) private voidflowExecute(int executeType) (package private) voidprivate ColumnMetaDataprotected StringReturns the name of the java.sql interface implemented by this class.private ColumnMetaDataprivate ClientParameterMetaDataprivate voidprivate voidprivate voidinitPreparedStatement(String sql, Section section) protected voidvoidprotected voidmarkClosed(boolean removeListener) This method cleans up client-side resources held by this Statement.(package private) voidprepare()private voidprivate voidprivate voidprivate voidvoidreset(boolean fullReset) (package private) voidResets the prepared statement for reuse in a statement pool.private voidvoidresetPreparedStatement(Agent agent, ClientConnection connection, String sql, int type, int concurrency, int holdability, int autoGeneratedKeys, String[] columnNames, int[] columnIndexes) private voidresetPreparedStatement(Agent agent, ClientConnection connection, String sql, Section section) voidvoidsetAsciiStream(int parameterIndex, InputStream x) Sets the designated parameter to the given input stream.voidsetAsciiStream(int parameterIndex, InputStream x, int length) We do this inefficiently and read it all in here.voidsetAsciiStream(int parameterIndex, InputStream x, long length) We do this inefficiently and read it all in here.voidsetBigDecimal(int parameterIndex, BigDecimal x) voidsetBinaryStream(int parameterIndex, InputStream x) Sets the designated parameter to the given input stream.voidsetBinaryStream(int parameterIndex, InputStream x, int length) sets the parameter to the Binary Stream objectvoidsetBinaryStream(int parameterIndex, InputStream x, long length) sets the parameter to the Binary Stream objectprivate voidsetBinaryStreamX(int parameterIndex, InputStream x, int length) voidsetBlob(int parameterIndex, InputStream inputStream) Sets the designated parameter to aInputStreamobject.voidsetBlob(int parameterIndex, InputStream inputStream, long length) Sets the designated parameter to a InputStream object.voidprivate voidvoidsetBoolean(int parameterIndex, boolean x) voidsetByte(int parameterIndex, byte x) voidsetBytes(int parameterIndex, byte[] x) (package private) voidsetBytesX(int parameterIndex, byte[] x) voidsetCharacterStream(int parameterIndex, Reader x) Sets the designated parameter to the givenReaderobject.voidsetCharacterStream(int parameterIndex, Reader x, int length) Sets the designated parameter to the given Reader, which will have the specified number of bytes.voidsetCharacterStream(int parameterIndex, Reader x, long length) Sets the designated parameter to the given Reader, which will have the specified number of bytes.voidSets the designated parameter to aReaderobject.voidSets the designated parameter to a Reader object.voidprivate voidvoidvoidvoidsetDouble(int parameterIndex, double x) voidsetFloat(int parameterIndex, float x) (package private) voidvoidsetInt(int parameterIndex, int x) (package private) voidsetIntX(int parameterIndex, int x) voidsetLong(int parameterIndex, long x) (package private) voidsetLongX(int parameterIndex, long x) voidsetNCharacterStream(int parameterIndex, Reader value) voidsetNCharacterStream(int index, Reader value, long length) voidvoidvoidvoidsetNString(int index, String value) voidsetNull(int parameterIndex, int jdbcType) void(package private) voidsetNullX(int parameterIndex, int jdbcType) voidvoidvoidprivate voidsetObjectX(int parameterIndex, Object x, int targetJdbcType, int scale) voidvoidvoidsetShort(int parameterIndex, short x) (package private) voidsetShortX(int parameterIndex, short x) voidvoid(package private) voidsetStringX(int parameterIndex, String x) voidvoidvoidsetTimestamp(int parameterIndex, Timestamp x) voidsetTimestamp(int parameterIndex, Timestamp x, Calendar calendar) private voidSet a UDT parameter to an object value.voidsetUnicodeStream(int parameterIndex, InputStream x, int length) Deprecated.voidprivate voidwriteDescribeInput(Section section) private voidwriteExecute(Section section, ColumnMetaData parameterMetaData, Object[] inputs, int numInputColumns, boolean outputExpected, boolean chainedWritesFollowingSetLob) private voidwriteOpenQuery(Section section, int fetchSize, int resultSetType, int numInputColumns, ColumnMetaData parameterMetaData, Object[] inputs) private voidprivate voidMethods inherited from class ClientStatement
accumulateWarning, cacheCursorAttributesToSendOnPrepare, cancel, checkAutoGeneratedKeysParameters, checkForAppropriateSqlMode, checkForClosedStatement, checkForDuplicateCursorName, checkForStoredProcResultSetCount, clearBatch, clearWarnings, clearWarningsX, close, closeMeOnCompletion, closeOnCompletion, closeX, completeExecute, completeExecuteCall, completeExecuteCall, completeExecuteCallOpenQuery, completeExecuteImmediate, completeExecuteSetStatement, completeOpenQuery, completePrepare, completePrepareDescribeOutput, completeSqlca, escape, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeX, extractCursorNameFromWhereCurrentOf, finalize, getConnection, getConnectionCallbackInterface, getFetchDirection, getFetchSize, getGeneratedKeys, getGuessedResultSetMetaData, getLargeMaxRows, getLargeUpdateCount, getMaterialStatement, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getOwner, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getSection, getSqlWarnings, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isPoolable, isQueryMode, isWrapperFor, markClosed, markResultSetsClosed, parseSqlAndSetSqlModes, parseStorProcReturnedScrollableRowset, prepareAutoGeneratedKeysStatement, readClose, readCloseResultSets, readExecuteCall, readOpenQuery, readPrepare, readPrepareDescribeOutput, readSetSpecialRegister, removeClientCursorNameFromCache, resetCursorNameAndRemoveFromWhereCurrentOfMappings, resetResultSetList, resetStatement, resetStatement, resultSetCommitting, resultSetCommitting, setCursorName, setEscapeProcessing, setFetchDirection, setFetchedRowBase, setFetchSize, setLargeMaxRows, setMaterialStatement, setMaxFieldSize, setMaxRows, setOwner, setPoolable, setQueryTimeout, setSection, setupCursorNameCacheAndMappings, setUpdateCount, substituteClientCursorNameWithServerCursorName, unwrap, writeClose, writeCloseResultSets, writeExecuteCall, writeOpenQuery, writePrepare, writePrepareDescribeOutput, writeSetSpecialRegisterMethods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PreparedStatement
setObject, setObjectMethods inherited from interface Statement
cancel, clearBatch, clearWarnings, close, closeOnCompletion, enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getLargeMaxRows, getLargeUpdateCount, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isPoolable, isSimpleIdentifier, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeoutMethods inherited from interface StatementCallbackInterface
accumulateWarning, completeExecute, completeExecuteCall, completeExecuteCall, completeExecuteCallOpenQuery, completeExecuteImmediate, completeExecuteSetStatement, completeOpenQuery, completePrepare, completePrepareDescribeOutput, completeSqlca, getConnectionCallbackInterface, getGuessedResultSetMetaDataMethods inherited from interface Wrapper
isWrapperFor, unwrap
-
Field Details
-
materialPreparedStatement_
-
sql_
String sql_ -
outputRegistered_
boolean outputRegistered_ -
parameters_
Object[] parameters_ -
parameterSet_
private boolean[] parameterSet_ -
parameterRegistered_
boolean[] parameterRegistered_ -
parameterMetaData_
ColumnMetaData parameterMetaData_ -
parameterTypeList
-
positionedUpdateCursorName_
-
pooledConnection_
-
listenToUnitOfWork_
private boolean listenToUnitOfWork_
-
-
Constructor Details
-
ClientPreparedStatement
public ClientPreparedStatement(Agent agent, ClientConnection connection, String sql, Section section, ClientPooledConnection cpc) throws SqlException The PreparedStatement constructor used for JDBC 2 positioned update statements. Called by material statement constructors. It has the ClientPooledConnection as one of its parameters this is used to raise the Statement Events when the prepared statement is closed- Parameters:
agent- The instance of NetAgent associated with this CallableStatement object.connection- The connection object associated with this PreparedStatement Object.sql- A String object that is the SQL statement to be sent to the database.section- Sectioncpc- The ClientPooledConnection wraps the underlying physical connection associated with this prepared statement. It is used to pass the Statement closed and the Statement error occurred events that occur back to the ClientPooledConnection.- Throws:
SqlException
-
ClientPreparedStatement
public ClientPreparedStatement(Agent agent, ClientConnection connection, String sql, int type, int concurrency, int holdability, int autoGeneratedKeys, String[] columnNames, int[] columnIndexes, ClientPooledConnection cpc) throws SqlException The PreparedStatementConstructor used for jdbc 2 prepared statements with scroll attributes. Called by material statement constructors. It has the ClientPooledConnection as one of its parameters this is used to raise the Statement Events when the prepared statement is closed- Parameters:
agent- The instance of NetAgent associated with this CallableStatement object.connection- The connection object associated with this PreparedStatement Object.sql- A String object that is the SQL statement to be sent to the database.type- One of the ResultSet type constants.concurrency- One of the ResultSet concurrency constants.holdability- One of the ResultSet holdability constants.autoGeneratedKeys- a flag indicating whether auto-generated keys should be returned.columnNames- an array of column names indicating the columns that should be returned from the inserted row or rows.columnIndexes- an array of column names indicating the columns that should be returned from the inserted row.cpc- The ClientPooledConnection wraps the underlying physical connection associated with this prepared statement it is used to pass the Statement closed and the Statement error occurred events that occur back to the ClientPooledConnection.- Throws:
SqlException
-
-
Method Details
-
setInput
-
initPreparedStatement
private void initPreparedStatement() -
initResetPreparedStatement
protected void initResetPreparedStatement()- Overrides:
initResetPreparedStatementin classClientStatement
-
reset
- Overrides:
resetin classClientStatement- Throws:
SqlException
-
resetForReuse
Resets the prepared statement for reuse in a statement pool.- Overrides:
resetForReusein classClientStatement- Throws:
SqlException- if the reset fails- See Also:
-
resetParameters
private void resetParameters() -
resetPreparedStatement
private void resetPreparedStatement(Agent agent, ClientConnection connection, String sql, Section section) throws SqlException - Throws:
SqlException
-
initPreparedStatement
- Throws:
SqlException
-
resetPreparedStatement
public void resetPreparedStatement(Agent agent, ClientConnection connection, String sql, int type, int concurrency, int holdability, int autoGeneratedKeys, String[] columnNames, int[] columnIndexes) throws SqlException - Throws:
SqlException
-
initPreparedStatement
- Throws:
SqlException
-
prepare
- Throws:
SqlException
-
addBatch
- Specified by:
addBatchin interfaceStatement- Overrides:
addBatchin classClientStatement- Throws:
SQLException
-
execute
- Specified by:
executein interfaceStatement- Overrides:
executein classClientStatement- Throws:
SQLException
-
executeQuery
- Specified by:
executeQueryin interfaceStatement- Overrides:
executeQueryin classClientStatement- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdatein interfaceStatement- Overrides:
executeUpdatein classClientStatement- Throws:
SQLException
-
executeQuery
- Specified by:
executeQueryin interfacePreparedStatement- Throws:
SQLException
-
executeQueryX
- Throws:
SqlException
-
executeUpdate
- Specified by:
executeUpdatein interfacePreparedStatement- Throws:
SQLException
-
executeUpdateX
- Throws:
SqlException
-
setNull
- Specified by:
setNullin interfacePreparedStatement- Throws:
SQLException
-
setNullX
- Throws:
SqlException
-
setNull
- Specified by:
setNullin interfacePreparedStatement- Throws:
SQLException
-
setBoolean
- Specified by:
setBooleanin interfacePreparedStatement- Throws:
SQLException
-
setByte
- Specified by:
setBytein interfacePreparedStatement- Throws:
SQLException
-
setShort
- Specified by:
setShortin interfacePreparedStatement- Throws:
SQLException
-
setShortX
- Throws:
SqlException
-
setInt
- Specified by:
setIntin interfacePreparedStatement- Throws:
SQLException
-
setIntX
- Throws:
SqlException
-
setLong
- Specified by:
setLongin interfacePreparedStatement- Throws:
SQLException
-
setLongX
void setLongX(int parameterIndex, long x) -
setFloat
- Specified by:
setFloatin interfacePreparedStatement- Throws:
SQLException
-
setDouble
- Specified by:
setDoublein interfacePreparedStatement- Throws:
SQLException
-
setBigDecimal
- Specified by:
setBigDecimalin interfacePreparedStatement- Throws:
SQLException
-
setDate
- Specified by:
setDatein interfacePreparedStatement- Throws:
SQLException
-
setDate
- Specified by:
setDatein interfacePreparedStatement- Throws:
SQLException
-
setTime
- Specified by:
setTimein interfacePreparedStatement- Throws:
SQLException
-
setTime
- Specified by:
setTimein interfacePreparedStatement- Throws:
SQLException
-
setTimestamp
- Specified by:
setTimestampin interfacePreparedStatement- Throws:
SQLException
-
setTimestamp
- Specified by:
setTimestampin interfacePreparedStatement- Throws:
SQLException
-
setString
- Specified by:
setStringin interfacePreparedStatement- Throws:
SQLException
-
setStringX
- Throws:
SqlException
-
setBytes
- Specified by:
setBytesin interfacePreparedStatement- Throws:
SQLException
-
setBytesX
- Throws:
SqlException
-
setBinaryStream
sets the parameter to the Binary Stream object- Specified by:
setBinaryStreamin interfacePreparedStatement- Parameters:
parameterIndex- the first parameter is 1, the second is 2, ...x- the java input stream which contains the binary parameter valuelength- the number of bytes in the stream- Throws:
SQLException- thrown on failure.
-
setBinaryStream
sets the parameter to the Binary Stream object- Specified by:
setBinaryStreamin interfacePreparedStatement- Parameters:
parameterIndex- the first parameter is 1, the second is 2, ...x- the java input stream which contains the binary parameter valuelength- the number of bytes in the stream- Throws:
SQLException- thrown on failure.
-
setBinaryStreamX
- Throws:
SqlException
-
setAsciiStream
We do this inefficiently and read it all in here. The target type is assumed to be a String.- Specified by:
setAsciiStreamin interfacePreparedStatement- Parameters:
parameterIndex- the first parameter is 1, the second is 2, ...x- the java input stream which contains the ASCII parameter valuelength- the number of bytes in the stream- Throws:
SQLException- thrown on failure.
-
setAsciiStream
We do this inefficiently and read it all in here. The target type is assumed to be a String.- Specified by:
setAsciiStreamin interfacePreparedStatement- Parameters:
parameterIndex- the first parameter is 1, the second is 2, ...x- the java input stream which contains the ASCII parameter valuelength- the number of bytes in the stream- Throws:
SQLException- thrown on failure.
-
checkStreamLength
Check the length passed in for the stream that is to be set. If length is larger than Integer.MAX_VALUE or smaller that 0, we fail by throwing an SQLException.- Parameters:
length- The length of the stream being set- Throws:
SQLException- Thrown for a negative or too large length.
-
checkTypeForSetAsciiStream
- Throws:
SqlExceptionSQLException
-
checkTypeForSetBinaryStream
- Throws:
SqlExceptionSQLException
-
checkTypeForSetCharacterStream
- Throws:
SqlExceptionSQLException
-
checkTypeForSetBlob
- Throws:
SqlExceptionSQLException
-
checkTypeForSetClob
- Throws:
SqlExceptionSQLException
-
setUnicodeStream
Deprecated.Sets the specified parameter to the given input stream. Deprecated in JDBC 3.0 and this method will always just throw a feature not implemented exception.- Specified by:
setUnicodeStreamin interfacePreparedStatement- Parameters:
parameterIndex- the first parameter is 1, the second is 2, ...x- the java input stream which contains the UNICODE parameter valuelength- the number of bytes in the stream- Throws:
SQLException- throws feature not implemented.
-
setCharacterStream
Sets the designated parameter to the givenReaderobject. When a very large UNICODE value is input to a LONGVARCHAR parameter, it may be more practical to send it via ajava.io.Readerobject. The data will be read from the stream as needed until end-of-file is reached. The JDBC driver will do any necessary conversion from UNICODE to the database char format.- Specified by:
setCharacterStreamin interfacePreparedStatement- Parameters:
parameterIndex- the first parameter is 1, the second is 2, ...x- thejava.io.Readerobject that contains the Unicode data- Throws:
SQLException- if a database access error occurs or this method is called on a closedPreparedStatement
-
setCharacterStream
Sets the designated parameter to the given Reader, which will have the specified number of bytes.- Specified by:
setCharacterStreamin interfacePreparedStatement- Parameters:
parameterIndex- the index of the parameter to which this set method is appliedx- the java Reader which contains the UNICODE valuelength- the number of bytes in the stream- Throws:
SQLException- thrown on failure.
-
setCharacterStream
Sets the designated parameter to the given Reader, which will have the specified number of bytes.- Specified by:
setCharacterStreamin interfacePreparedStatement- Parameters:
parameterIndex- the index of the parameter to which this set method is appliedx- the java Reader which contains the UNICODE valuelength- the number of bytes in the stream- Throws:
SQLException- thrown on failure.
-
setBlob
- Specified by:
setBlobin interfacePreparedStatement- Throws:
SQLException
-
setBlobX
- Throws:
SqlException
-
setClob
- Specified by:
setClobin interfacePreparedStatement- Throws:
SQLException
-
setClobX
- Throws:
SqlException
-
setArray
- Specified by:
setArrayin interfacePreparedStatement- Throws:
SQLException
-
setRef
- Specified by:
setRefin interfacePreparedStatement- Throws:
SQLException
-
setObject
- Specified by:
setObjectin interfacePreparedStatement- Throws:
SQLException
-
setUDTX
Set a UDT parameter to an object value.- Throws:
SqlExceptionSQLException
-
setObject
- Specified by:
setObjectin interfacePreparedStatement- Throws:
SQLException
-
setObject
public void setObject(int parameterIndex, Object x, int targetJdbcType, int scale) throws SQLException - Specified by:
setObjectin interfacePreparedStatement- Throws:
SQLException
-
setObjectX
private void setObjectX(int parameterIndex, Object x, int targetJdbcType, int scale) throws SqlException - Throws:
SqlException
-
clearParameters
- Specified by:
clearParametersin interfacePreparedStatement- Throws:
SQLException
-
execute
- Specified by:
executein interfacePreparedStatement- Throws:
SQLException
-
executeX
- Throws:
SqlException
-
addBatch
- Specified by:
addBatchin interfacePreparedStatement- Throws:
SQLException
-
executeBatch
- Specified by:
executeBatchin interfaceStatement- Overrides:
executeBatchin classClientStatement- Throws:
SQLException
-
getMetaData
- Specified by:
getMetaDatain interfacePreparedStatement- Throws:
SQLException
-
getMetaDataX
- Throws:
SqlException
-
execute
- Specified by:
executein interfaceStatement- Overrides:
executein classClientStatement- Throws:
SQLException
-
execute
- Specified by:
executein interfaceStatement- Overrides:
executein classClientStatement- Throws:
SQLException
-
execute
- Specified by:
executein interfaceStatement- Overrides:
executein classClientStatement- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdatein interfaceStatement- Overrides:
executeUpdatein classClientStatement- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdatein interfaceStatement- Overrides:
executeUpdatein classClientStatement- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdatein interfaceStatement- Overrides:
executeUpdatein classClientStatement- Throws:
SQLException
-
setURL
- Specified by:
setURLin interfacePreparedStatement- Throws:
SQLException
-
getParameterMetaData
- Specified by:
getParameterMetaDatain interfacePreparedStatement- Throws:
SQLException
-
getParameterMetaDataX
- Throws:
SqlException
-
getColumnMetaDataX
- Throws:
SqlException
-
writeExecute
private void writeExecute(Section section, ColumnMetaData parameterMetaData, Object[] inputs, int numInputColumns, boolean outputExpected, boolean chainedWritesFollowingSetLob) throws SqlException - Throws:
SqlException
-
readExecute
- Throws:
SqlException
-
writeOpenQuery
private void writeOpenQuery(Section section, int fetchSize, int resultSetType, int numInputColumns, ColumnMetaData parameterMetaData, Object[] inputs) throws SqlException - Throws:
SqlException
-
writeDescribeInput
- Throws:
SqlException
-
readDescribeInput
- Throws:
SqlException
-
completeDescribeInput
- Specified by:
completeDescribeInputin interfacePreparedStatementCallbackInterface
-
completeDescribeOutput
- Specified by:
completeDescribeOutputin interfacePreparedStatementCallbackInterface
-
writePrepareDescribeInputOutput
- Throws:
SqlException
-
readPrepareDescribeInputOutput
- Throws:
SqlException
-
writePrepareDescribeInput
- Throws:
SqlException
-
readPrepareDescribeInput
- Throws:
SqlException
-
completePrepareDescribe
private void completePrepareDescribe() -
expandObjectArray
-
expandBooleanArray
private boolean[] expandBooleanArray(boolean[] array, int newLength) -
flowPrepareDescribeInputOutput
- Throws:
SqlException
-
flowExecute
- Throws:
SqlException
-
executeBatchX
- Throws:
SqlExceptionSQLException
-
executeBatchRequestX
private long[] executeBatchRequestX(boolean supportsQueryBatchRequest) throws SqlException, BatchUpdateException - Throws:
SqlExceptionBatchUpdateException
-
listenToUnitOfWork
public void listenToUnitOfWork()- Specified by:
listenToUnitOfWorkin interfaceUnitOfWorkListener- Overrides:
listenToUnitOfWorkin classClientStatement
-
completeLocalCommit
- Specified by:
completeLocalCommitin interfaceUnitOfWorkListener- Overrides:
completeLocalCommitin classClientStatement
-
completeLocalRollback
- Specified by:
completeLocalRollbackin interfaceUnitOfWorkListener- Overrides:
completeLocalRollbackin classClientStatement
-
getJdbcStatementInterfaceName
Returns the name of the java.sql interface implemented by this class.- Overrides:
getJdbcStatementInterfaceNamein classClientStatement- Returns:
- name of java.sql interface
-
checkForValidParameterIndex
- Throws:
SqlException
-
checkThatAllParametersAreSet
- Throws:
SqlException
-
checkForValidScale
- Throws:
SqlException
-
markClosed
protected void markClosed(boolean removeListener) Description copied from class:ClientStatementThis method cleans up client-side resources held by this Statement. If removeListener is true, the Statement is removed from open statements list and PreparedStatement is also removed from commit and rollback listeners list. This is called from the close methods.- Overrides:
markClosedin classClientStatement- Parameters:
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 inorg.apache.derby.client.am.Connection.
-
setAsciiStream
Sets the designated parameter to the given input stream. When a very large ASCII value is input to aLONGVARCHARparameter, it may be more practical to send it via ajava.io.InputStream. Data will be read from the stream as needed until end-of-file is reached. The JDBC driver will do any necessary conversion from ASCII to the database char format.- Specified by:
setAsciiStreamin interfacePreparedStatement- Parameters:
parameterIndex- the first parameter is 1, the second is 2, ...x- the Java input stream that contains the ASCII parameter value- Throws:
SQLException- if a database access error occurs or this method is called on a closedPreparedStatement
-
setBinaryStream
Sets the designated parameter to the given input stream. When a very large binary value is input to aLONGVARBINARYparameter, it may be more practical to send it via ajava.io.InputStreamobject. The data will be read from the stream as needed until end-of-file is reached.- Specified by:
setBinaryStreamin interfacePreparedStatement- Parameters:
parameterIndex- the first parameter is 1, the second is 2, ...x- the java input stream which contains the binary parameter value- Throws:
SQLException- if a database access error occurs or this method is called on a closedPreparedStatement
-
setClob
Sets the designated parameter to aReaderobject.- Specified by:
setClobin interfacePreparedStatement- Parameters:
parameterIndex- index of the first parameter is 1, the second is 2, ...reader- an object that contains the data to set the parameter value to.- Throws:
SQLException- if parameterIndex does not correspond to a parameter marker in the SQL statement; if a database access error occurs; this method is called on a closed PreparedStatementor if parameterIndex does not correspond to a parameter marker in the SQL statement
-
setClob
Sets the designated parameter to a Reader object.- Specified by:
setClobin interfacePreparedStatement- Parameters:
parameterIndex- index of the first parameter is 1, the second is 2, ...reader- An object that contains the data to set the parameter value to.length- the number of characters in the parameter data.- Throws:
SQLException- if parameterIndex does not correspond to a parameter marker in the SQL statement, or if the length specified is less than zero.
-
setBlob
Sets the designated parameter to aInputStreamobject. This method differs from thesetBinaryStream(int, InputStream)method because it informs the driver that the parameter value should be sent to the server as aBLOB. When thesetBinaryStreammethod is used, the driver may have to do extra work to determine whether the parameter data should be sent to the server as aLONGVARBINARYor aBLOB- Specified by:
setBlobin interfacePreparedStatement- Parameters:
parameterIndex- index of the first parameter is 1, the second is 2, ...inputStream- an object that contains the data to set the parameter value to.- Throws:
SQLException- if a database access error occurs, this method is called on a closedPreparedStatementor ifparameterIndexdoes not correspond to a parameter marker in the SQL statement
-
setBlob
Sets the designated parameter to a InputStream object.- Specified by:
setBlobin interfacePreparedStatement- Parameters:
parameterIndex- index of the first parameter is 1, the second is 2, ...inputStream- An object that contains the data to set the parameter value to.length- the number of bytes in the parameter data.- Throws:
SQLException- if parameterIndex does not correspond to a parameter marker in the SQL statement, if the length specified is less than zero or if the number of bytes in the inputstream does not match the specfied length.
-
setNString
- Specified by:
setNStringin interfacePreparedStatement- Throws:
SQLException
-
setNCharacterStream
- Specified by:
setNCharacterStreamin interfacePreparedStatement- Throws:
SQLException
-
setNCharacterStream
- Specified by:
setNCharacterStreamin interfacePreparedStatement- Throws:
SQLException
-
setNClob
- Specified by:
setNClobin interfacePreparedStatement- Throws:
SQLException
-
setNClob
- Specified by:
setNClobin interfacePreparedStatement- Throws:
SQLException
-
setRowId
- Specified by:
setRowIdin interfacePreparedStatement- Throws:
SQLException
-
setNClob
- Specified by:
setNClobin interfacePreparedStatement- Throws:
SQLException
-
setSQLXML
- Specified by:
setSQLXMLin interfacePreparedStatement- Throws:
SQLException
-
executeLargeUpdate
- Specified by:
executeLargeUpdatein interfacePreparedStatement- Throws:
SQLException
-
checkStatementValidity
- Throws:
SQLException
-
checkStatus
Check for closed statement and extract the SQLException if it is raised.
- Throws:
SQLException
-