Package org.apache.derby.client.am
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 class
PossibleTypes 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 ClientPooledConnection
private String
(package private) String
Fields inherited from class org.apache.derby.client.am.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 java.sql.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 TypeMethodDescriptionvoid
addBatch()
void
(package private) void
checkForValidParameterIndex
(int parameterIndex) (package private) void
checkForValidScale
(int scale) private void
protected void
Check for closed statement and extract the SQLException if it is raised.private void
checkStreamLength
(long length) Check the length passed in for the stream that is to be set.private void
private void
checkTypeForSetAsciiStream
(int parameterIndex) private void
checkTypeForSetBinaryStream
(int parameterIndex) private void
checkTypeForSetBlob
(int parameterIndex) private void
checkTypeForSetCharacterStream
(int parameterIndex) private void
checkTypeForSetClob
(int parameterIndex) void
void
completeDescribeInput
(ColumnMetaData parameterMetaData, Sqlca sqlca) void
completeDescribeOutput
(ColumnMetaData resultSetMetaData, Sqlca sqlca) void
completeLocalCommit
(Iterator listenerIterator) void
completeLocalRollback
(Iterator listenerIterator) private void
boolean
execute()
boolean
boolean
boolean
boolean
int[]
private long[]
executeBatchRequestX
(boolean supportsQueryBatchRequest) private long[]
executeBatchX
(boolean supportsQueryBatchRequest) long
executeQuery
(String sql) (package private) ClientResultSet
int
int
executeUpdate
(String sql) int
executeUpdate
(String sql, int autoGeneratedKeys) int
executeUpdate
(String sql, int[] columnIndexes) int
executeUpdate
(String sql, String[] columnNames) private long
(package private) boolean
executeX()
private boolean[]
expandBooleanArray
(boolean[] array, int newLength) private Object[]
expandObjectArray
(Object[] array, int newLength) private void
flowExecute
(int executeType) (package private) void
private ColumnMetaData
protected String
Returns the name of the java.sql interface implemented by this class.private ColumnMetaData
private ClientParameterMetaData
private void
private void
private void
initPreparedStatement
(String sql, Section section) protected void
void
protected void
markClosed
(boolean removeListener) This method cleans up client-side resources held by this Statement.(package private) void
prepare()
private void
private void
private void
private void
void
reset
(boolean fullReset) (package private) void
Resets the prepared statement for reuse in a statement pool.private void
void
resetPreparedStatement
(Agent agent, ClientConnection connection, String sql, int type, int concurrency, int holdability, int autoGeneratedKeys, String[] columnNames, int[] columnIndexes) private void
resetPreparedStatement
(Agent agent, ClientConnection connection, String sql, Section section) void
void
setAsciiStream
(int parameterIndex, InputStream x) Sets the designated parameter to the given input stream.void
setAsciiStream
(int parameterIndex, InputStream x, int length) We do this inefficiently and read it all in here.void
setAsciiStream
(int parameterIndex, InputStream x, long length) We do this inefficiently and read it all in here.void
setBigDecimal
(int parameterIndex, BigDecimal x) void
setBinaryStream
(int parameterIndex, InputStream x) Sets the designated parameter to the given input stream.void
setBinaryStream
(int parameterIndex, InputStream x, int length) sets the parameter to the Binary Stream objectvoid
setBinaryStream
(int parameterIndex, InputStream x, long length) sets the parameter to the Binary Stream objectprivate void
setBinaryStreamX
(int parameterIndex, InputStream x, int length) void
setBlob
(int parameterIndex, InputStream inputStream) Sets the designated parameter to aInputStream
object.void
setBlob
(int parameterIndex, InputStream inputStream, long length) Sets the designated parameter to a InputStream object.void
private void
void
setBoolean
(int parameterIndex, boolean x) void
setByte
(int parameterIndex, byte x) void
setBytes
(int parameterIndex, byte[] x) (package private) void
setBytesX
(int parameterIndex, byte[] x) void
setCharacterStream
(int parameterIndex, Reader x) Sets the designated parameter to the givenReader
object.void
setCharacterStream
(int parameterIndex, Reader x, int length) Sets the designated parameter to the given Reader, which will have the specified number of bytes.void
setCharacterStream
(int parameterIndex, Reader x, long length) Sets the designated parameter to the given Reader, which will have the specified number of bytes.void
Sets the designated parameter to aReader
object.void
Sets the designated parameter to a Reader object.void
private void
void
void
void
setDouble
(int parameterIndex, double x) void
setFloat
(int parameterIndex, float x) (package private) void
void
setInt
(int parameterIndex, int x) (package private) void
setIntX
(int parameterIndex, int x) void
setLong
(int parameterIndex, long x) (package private) void
setLongX
(int parameterIndex, long x) void
setNCharacterStream
(int parameterIndex, Reader value) void
setNCharacterStream
(int index, Reader value, long length) void
void
void
void
setNString
(int index, String value) void
setNull
(int parameterIndex, int jdbcType) void
(package private) void
setNullX
(int parameterIndex, int jdbcType) void
void
void
private void
setObjectX
(int parameterIndex, Object x, int targetJdbcType, int scale) void
void
void
setShort
(int parameterIndex, short x) (package private) void
setShortX
(int parameterIndex, short x) void
void
(package private) void
setStringX
(int parameterIndex, String x) void
void
void
setTimestamp
(int parameterIndex, Timestamp x) void
setTimestamp
(int parameterIndex, Timestamp x, Calendar calendar) private void
Set a UDT parameter to an object value.void
setUnicodeStream
(int parameterIndex, InputStream x, int length) Deprecated.void
private void
writeDescribeInput
(Section section) private void
writeExecute
(Section section, ColumnMetaData parameterMetaData, Object[] inputs, int numInputColumns, boolean outputExpected, boolean chainedWritesFollowingSetLob) private void
writeOpenQuery
(Section section, int fetchSize, int resultSetType, int numInputColumns, ColumnMetaData parameterMetaData, Object[] inputs) private void
private void
Methods inherited from class org.apache.derby.client.am.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, writeSetSpecialRegister
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.sql.PreparedStatement
setObject, setObject
Methods inherited from interface java.sql.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, setQueryTimeout
Methods inherited from interface org.apache.derby.client.am.StatementCallbackInterface
accumulateWarning, completeExecute, completeExecuteCall, completeExecuteCall, completeExecuteCallOpenQuery, completeExecuteImmediate, completeExecuteSetStatement, completeOpenQuery, completePrepare, completePrepareDescribeOutput, completeSqlca, getConnectionCallbackInterface, getGuessedResultSetMetaData
Methods inherited from interface java.sql.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:
initResetPreparedStatement
in classClientStatement
-
reset
- Overrides:
reset
in classClientStatement
- Throws:
SqlException
-
resetForReuse
Resets the prepared statement for reuse in a statement pool.- Overrides:
resetForReuse
in 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:
addBatch
in interfaceStatement
- Overrides:
addBatch
in classClientStatement
- Throws:
SQLException
-
execute
- Specified by:
execute
in interfaceStatement
- Overrides:
execute
in classClientStatement
- Throws:
SQLException
-
executeQuery
- Specified by:
executeQuery
in interfaceStatement
- Overrides:
executeQuery
in classClientStatement
- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdate
in interfaceStatement
- Overrides:
executeUpdate
in classClientStatement
- Throws:
SQLException
-
executeQuery
- Specified by:
executeQuery
in interfacePreparedStatement
- Throws:
SQLException
-
executeQueryX
- Throws:
SqlException
-
executeUpdate
- Specified by:
executeUpdate
in interfacePreparedStatement
- Throws:
SQLException
-
executeUpdateX
- Throws:
SqlException
-
setNull
- Specified by:
setNull
in interfacePreparedStatement
- Throws:
SQLException
-
setNullX
- Throws:
SqlException
-
setNull
- Specified by:
setNull
in interfacePreparedStatement
- Throws:
SQLException
-
setBoolean
- Specified by:
setBoolean
in interfacePreparedStatement
- Throws:
SQLException
-
setByte
- Specified by:
setByte
in interfacePreparedStatement
- Throws:
SQLException
-
setShort
- Specified by:
setShort
in interfacePreparedStatement
- Throws:
SQLException
-
setShortX
- Throws:
SqlException
-
setInt
- Specified by:
setInt
in interfacePreparedStatement
- Throws:
SQLException
-
setIntX
- Throws:
SqlException
-
setLong
- Specified by:
setLong
in interfacePreparedStatement
- Throws:
SQLException
-
setLongX
void setLongX(int parameterIndex, long x) -
setFloat
- Specified by:
setFloat
in interfacePreparedStatement
- Throws:
SQLException
-
setDouble
- Specified by:
setDouble
in interfacePreparedStatement
- Throws:
SQLException
-
setBigDecimal
- Specified by:
setBigDecimal
in interfacePreparedStatement
- Throws:
SQLException
-
setDate
- Specified by:
setDate
in interfacePreparedStatement
- Throws:
SQLException
-
setDate
- Specified by:
setDate
in interfacePreparedStatement
- Throws:
SQLException
-
setTime
- Specified by:
setTime
in interfacePreparedStatement
- Throws:
SQLException
-
setTime
- Specified by:
setTime
in interfacePreparedStatement
- Throws:
SQLException
-
setTimestamp
- Specified by:
setTimestamp
in interfacePreparedStatement
- Throws:
SQLException
-
setTimestamp
- Specified by:
setTimestamp
in interfacePreparedStatement
- Throws:
SQLException
-
setString
- Specified by:
setString
in interfacePreparedStatement
- Throws:
SQLException
-
setStringX
- Throws:
SqlException
-
setBytes
- Specified by:
setBytes
in interfacePreparedStatement
- Throws:
SQLException
-
setBytesX
- Throws:
SqlException
-
setBinaryStream
sets the parameter to the Binary Stream object- Specified by:
setBinaryStream
in 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:
setBinaryStream
in 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:
setAsciiStream
in 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:
setAsciiStream
in 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:
SqlException
SQLException
-
checkTypeForSetBinaryStream
- Throws:
SqlException
SQLException
-
checkTypeForSetCharacterStream
- Throws:
SqlException
SQLException
-
checkTypeForSetBlob
- Throws:
SqlException
SQLException
-
checkTypeForSetClob
- Throws:
SqlException
SQLException
-
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:
setUnicodeStream
in 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 givenReader
object. When a very large UNICODE value is input to a LONGVARCHAR parameter, it may be more practical to send it via ajava.io.Reader
object. 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:
setCharacterStream
in interfacePreparedStatement
- Parameters:
parameterIndex
- the first parameter is 1, the second is 2, ...x
- thejava.io.Reader
object 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:
setCharacterStream
in 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:
setCharacterStream
in 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:
setBlob
in interfacePreparedStatement
- Throws:
SQLException
-
setBlobX
- Throws:
SqlException
-
setClob
- Specified by:
setClob
in interfacePreparedStatement
- Throws:
SQLException
-
setClobX
- Throws:
SqlException
-
setArray
- Specified by:
setArray
in interfacePreparedStatement
- Throws:
SQLException
-
setRef
- Specified by:
setRef
in interfacePreparedStatement
- Throws:
SQLException
-
setObject
- Specified by:
setObject
in interfacePreparedStatement
- Throws:
SQLException
-
setUDTX
Set a UDT parameter to an object value.- Throws:
SqlException
SQLException
-
setObject
- Specified by:
setObject
in interfacePreparedStatement
- Throws:
SQLException
-
setObject
public void setObject(int parameterIndex, Object x, int targetJdbcType, int scale) throws SQLException - Specified by:
setObject
in interfacePreparedStatement
- Throws:
SQLException
-
setObjectX
private void setObjectX(int parameterIndex, Object x, int targetJdbcType, int scale) throws SqlException - Throws:
SqlException
-
clearParameters
- Specified by:
clearParameters
in interfacePreparedStatement
- Throws:
SQLException
-
execute
- Specified by:
execute
in interfacePreparedStatement
- Throws:
SQLException
-
executeX
- Throws:
SqlException
-
addBatch
- Specified by:
addBatch
in interfacePreparedStatement
- Throws:
SQLException
-
executeBatch
- Specified by:
executeBatch
in interfaceStatement
- Overrides:
executeBatch
in classClientStatement
- Throws:
SQLException
-
getMetaData
- Specified by:
getMetaData
in interfacePreparedStatement
- Throws:
SQLException
-
getMetaDataX
- Throws:
SqlException
-
execute
- Specified by:
execute
in interfaceStatement
- Overrides:
execute
in classClientStatement
- Throws:
SQLException
-
execute
- Specified by:
execute
in interfaceStatement
- Overrides:
execute
in classClientStatement
- Throws:
SQLException
-
execute
- Specified by:
execute
in interfaceStatement
- Overrides:
execute
in classClientStatement
- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdate
in interfaceStatement
- Overrides:
executeUpdate
in classClientStatement
- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdate
in interfaceStatement
- Overrides:
executeUpdate
in classClientStatement
- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdate
in interfaceStatement
- Overrides:
executeUpdate
in classClientStatement
- Throws:
SQLException
-
setURL
- Specified by:
setURL
in interfacePreparedStatement
- Throws:
SQLException
-
getParameterMetaData
- Specified by:
getParameterMetaData
in 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:
completeDescribeInput
in interfacePreparedStatementCallbackInterface
-
completeDescribeOutput
- Specified by:
completeDescribeOutput
in 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:
SqlException
SQLException
-
executeBatchRequestX
private long[] executeBatchRequestX(boolean supportsQueryBatchRequest) throws SqlException, BatchUpdateException - Throws:
SqlException
BatchUpdateException
-
listenToUnitOfWork
public void listenToUnitOfWork()- Specified by:
listenToUnitOfWork
in interfaceUnitOfWorkListener
- Overrides:
listenToUnitOfWork
in classClientStatement
-
completeLocalCommit
- Specified by:
completeLocalCommit
in interfaceUnitOfWorkListener
- Overrides:
completeLocalCommit
in classClientStatement
-
completeLocalRollback
- Specified by:
completeLocalRollback
in interfaceUnitOfWorkListener
- Overrides:
completeLocalRollback
in classClientStatement
-
getJdbcStatementInterfaceName
Returns the name of the java.sql interface implemented by this class.- Overrides:
getJdbcStatementInterfaceName
in 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:ClientStatement
This 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:
markClosed
in 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 aLONGVARCHAR
parameter, 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:
setAsciiStream
in 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 aLONGVARBINARY
parameter, it may be more practical to send it via ajava.io.InputStream
object. The data will be read from the stream as needed until end-of-file is reached.- Specified by:
setBinaryStream
in 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 aReader
object.- Specified by:
setClob
in 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:
setClob
in 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 aInputStream
object. 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 thesetBinaryStream
method is used, the driver may have to do extra work to determine whether the parameter data should be sent to the server as aLONGVARBINARY
or aBLOB
- Specified by:
setBlob
in 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 closedPreparedStatement
or ifparameterIndex
does not correspond to a parameter marker in the SQL statement
-
setBlob
Sets the designated parameter to a InputStream object.- Specified by:
setBlob
in 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:
setNString
in interfacePreparedStatement
- Throws:
SQLException
-
setNCharacterStream
- Specified by:
setNCharacterStream
in interfacePreparedStatement
- Throws:
SQLException
-
setNCharacterStream
- Specified by:
setNCharacterStream
in interfacePreparedStatement
- Throws:
SQLException
-
setNClob
- Specified by:
setNClob
in interfacePreparedStatement
- Throws:
SQLException
-
setNClob
- Specified by:
setNClob
in interfacePreparedStatement
- Throws:
SQLException
-
setRowId
- Specified by:
setRowId
in interfacePreparedStatement
- Throws:
SQLException
-
setNClob
- Specified by:
setNClob
in interfacePreparedStatement
- Throws:
SQLException
-
setSQLXML
- Specified by:
setSQLXML
in interfacePreparedStatement
- Throws:
SQLException
-
executeLargeUpdate
- Specified by:
executeLargeUpdate
in interfacePreparedStatement
- Throws:
SQLException
-
checkStatementValidity
- Throws:
SQLException
-
checkStatus
Check for closed statement and extract the SQLException if it is raised.
- Throws:
SQLException
-