java.lang.AutoCloseable, java.sql.PreparedStatement, java.sql.Statement, java.sql.Wrapper, PreparedStatementCallbackInterface, StatementCallbackInterface, UnitOfWorkListenerClientCallableStatement, ClientPreparedStatement42public class ClientPreparedStatement extends ClientStatement implements java.sql.PreparedStatement, PreparedStatementCallbackInterface
| Modifier and Type | Class | Description |
|---|---|---|
private static class |
ClientPreparedStatement.PossibleTypes |
PossibleTypes is information which is set of types.
|
| Modifier and Type | Field | Description |
|---|---|---|
private boolean |
listenToUnitOfWork_ |
|
MaterialPreparedStatement |
materialPreparedStatement_ |
|
(package private) boolean |
outputRegistered_ |
|
(package private) ColumnMetaData |
parameterMetaData_ |
|
(package private) boolean[] |
parameterRegistered_ |
|
(package private) java.lang.Object[] |
parameters_ |
|
private boolean[] |
parameterSet_ |
|
private java.util.ArrayList<int[]> |
parameterTypeList |
|
private ClientPooledConnection |
pooledConnection_ |
|
private java.lang.String |
positionedUpdateCursorName_ |
|
(package private) java.lang.String |
sql_ |
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_| Constructor | Description |
|---|---|
ClientPreparedStatement(Agent agent,
ClientConnection connection,
java.lang.String sql,
int type,
int concurrency,
int holdability,
int autoGeneratedKeys,
java.lang.String[] columnNames,
int[] columnIndexes,
ClientPooledConnection cpc) |
The PreparedStatementConstructor used for jdbc 2 prepared statements
with scroll attributes.
|
ClientPreparedStatement(Agent agent,
ClientConnection connection,
java.lang.String sql,
Section section,
ClientPooledConnection cpc) |
The PreparedStatement constructor used for JDBC 2 positioned update
statements.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
addBatch() |
|
void |
addBatch(java.lang.String sql) |
|
(package private) void |
checkForValidParameterIndex(int parameterIndex) |
|
(package private) void |
checkForValidScale(int scale) |
|
private void |
checkStatementValidity(SqlException sqle) |
|
protected void |
checkStatus() |
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 |
checkThatAllParametersAreSet() |
|
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 |
clearParameters() |
|
void |
completeDescribeInput(ColumnMetaData parameterMetaData,
Sqlca sqlca) |
|
void |
completeDescribeOutput(ColumnMetaData resultSetMetaData,
Sqlca sqlca) |
|
void |
completeLocalCommit(java.util.Iterator listenerIterator) |
|
void |
completeLocalRollback(java.util.Iterator listenerIterator) |
|
private void |
completePrepareDescribe() |
|
boolean |
execute() |
|
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[] |
executeBatchRequestX(boolean supportsQueryBatchRequest) |
|
private long[] |
executeBatchX(boolean supportsQueryBatchRequest) |
|
long |
executeLargeUpdate() |
|
java.sql.ResultSet |
executeQuery() |
|
java.sql.ResultSet |
executeQuery(java.lang.String sql) |
|
(package private) ClientResultSet |
executeQueryX() |
|
int |
executeUpdate() |
|
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() |
|
(package private) boolean |
executeX() |
|
private boolean[] |
expandBooleanArray(boolean[] array,
int newLength) |
|
private java.lang.Object[] |
expandObjectArray(java.lang.Object[] array,
int newLength) |
|
private void |
flowExecute(int executeType) |
|
(package private) void |
flowPrepareDescribeInputOutput() |
|
private ColumnMetaData |
getColumnMetaDataX() |
|
protected java.lang.String |
getJdbcStatementInterfaceName() |
Returns the name of the java.sql interface implemented by this class.
|
java.sql.ResultSetMetaData |
getMetaData() |
|
private ColumnMetaData |
getMetaDataX() |
|
java.sql.ParameterMetaData |
getParameterMetaData() |
|
private ClientParameterMetaData |
getParameterMetaDataX() |
|
private void |
initPreparedStatement() |
|
private void |
initPreparedStatement(java.lang.String sql) |
|
private void |
initPreparedStatement(java.lang.String sql,
Section section) |
|
protected void |
initResetPreparedStatement() |
|
void |
listenToUnitOfWork() |
|
protected void |
markClosed(boolean removeListener) |
This method cleans up client-side resources held by this Statement.
|
(package private) void |
prepare() |
|
private void |
readDescribeInput() |
|
private void |
readExecute() |
|
private void |
readPrepareDescribeInput() |
|
private void |
readPrepareDescribeInputOutput() |
|
void |
reset(boolean fullReset) |
|
(package private) void |
resetForReuse() |
Resets the prepared statement for reuse in a statement pool.
|
private void |
resetParameters() |
|
void |
resetPreparedStatement(Agent agent,
ClientConnection connection,
java.lang.String sql,
int type,
int concurrency,
int holdability,
int autoGeneratedKeys,
java.lang.String[] columnNames,
int[] columnIndexes) |
|
private void |
resetPreparedStatement(Agent agent,
ClientConnection connection,
java.lang.String sql,
Section section) |
|
void |
setArray(int parameterIndex,
java.sql.Array x) |
|
void |
setAsciiStream(int parameterIndex,
java.io.InputStream x) |
Sets the designated parameter to the given input stream.
|
void |
setAsciiStream(int parameterIndex,
java.io.InputStream x,
int length) |
We do this inefficiently and read it all in here.
|
void |
setAsciiStream(int parameterIndex,
java.io.InputStream x,
long length) |
We do this inefficiently and read it all in here.
|
void |
setBigDecimal(int parameterIndex,
java.math.BigDecimal x) |
|
void |
setBinaryStream(int parameterIndex,
java.io.InputStream x) |
Sets the designated parameter to the given input stream.
|
void |
setBinaryStream(int parameterIndex,
java.io.InputStream x,
int length) |
sets the parameter to the Binary Stream object
|
void |
setBinaryStream(int parameterIndex,
java.io.InputStream x,
long length) |
sets the parameter to the Binary Stream object
|
private void |
setBinaryStreamX(int parameterIndex,
java.io.InputStream x,
int length) |
|
void |
setBlob(int parameterIndex,
java.io.InputStream inputStream) |
Sets the designated parameter to a
InputStream object. |
void |
setBlob(int parameterIndex,
java.io.InputStream inputStream,
long length) |
Sets the designated parameter to a InputStream object.
|
void |
setBlob(int parameterIndex,
java.sql.Blob x) |
|
private void |
setBlobX(int parameterIndex,
java.sql.Blob x) |
|
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,
java.io.Reader x) |
Sets the designated parameter to the given
Reader object. |
void |
setCharacterStream(int parameterIndex,
java.io.Reader x,
int length) |
Sets the designated parameter to the given Reader, which will have
the specified number of bytes.
|
void |
setCharacterStream(int parameterIndex,
java.io.Reader x,
long length) |
Sets the designated parameter to the given Reader, which will have
the specified number of bytes.
|
void |
setClob(int parameterIndex,
java.io.Reader reader) |
Sets the designated parameter to a
Reader object. |
void |
setClob(int parameterIndex,
java.io.Reader reader,
long length) |
Sets the designated parameter to a Reader object.
|
void |
setClob(int parameterIndex,
java.sql.Clob x) |
|
private void |
setClobX(int parameterIndex,
java.sql.Clob x) |
|
void |
setDate(int parameterIndex,
java.sql.Date x) |
|
void |
setDate(int parameterIndex,
java.sql.Date x,
java.util.Calendar calendar) |
|
void |
setDouble(int parameterIndex,
double x) |
|
void |
setFloat(int parameterIndex,
float x) |
|
(package private) void |
setInput(int parameterIndex,
java.lang.Object input) |
|
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,
java.io.Reader value) |
|
void |
setNCharacterStream(int index,
java.io.Reader value,
long length) |
|
void |
setNClob(int parameterIndex,
java.io.Reader reader) |
|
void |
setNClob(int parameterIndex,
java.io.Reader reader,
long length) |
|
void |
setNClob(int index,
java.sql.NClob value) |
|
void |
setNString(int index,
java.lang.String value) |
|
void |
setNull(int parameterIndex,
int jdbcType) |
|
void |
setNull(int parameterIndex,
int jdbcType,
java.lang.String typeName) |
|
(package private) void |
setNullX(int parameterIndex,
int jdbcType) |
|
void |
setObject(int parameterIndex,
java.lang.Object x) |
|
void |
setObject(int parameterIndex,
java.lang.Object x,
int targetJdbcType) |
|
void |
setObject(int parameterIndex,
java.lang.Object x,
int targetJdbcType,
int scale) |
|
private void |
setObjectX(int parameterIndex,
java.lang.Object x,
int targetJdbcType,
int scale) |
|
void |
setRef(int parameterIndex,
java.sql.Ref x) |
|
void |
setRowId(int parameterIndex,
java.sql.RowId x) |
|
void |
setShort(int parameterIndex,
short x) |
|
(package private) void |
setShortX(int parameterIndex,
short x) |
|
void |
setSQLXML(int parameterIndex,
java.sql.SQLXML xmlObject) |
|
void |
setString(int parameterIndex,
java.lang.String x) |
|
(package private) void |
setStringX(int parameterIndex,
java.lang.String x) |
|
void |
setTime(int parameterIndex,
java.sql.Time x) |
|
void |
setTime(int parameterIndex,
java.sql.Time x,
java.util.Calendar calendar) |
|
void |
setTimestamp(int parameterIndex,
java.sql.Timestamp x) |
|
void |
setTimestamp(int parameterIndex,
java.sql.Timestamp x,
java.util.Calendar calendar) |
|
private void |
setUDTX(int parameterIndex,
java.lang.Object x) |
Set a UDT parameter to an object value.
|
void |
setUnicodeStream(int parameterIndex,
java.io.InputStream x,
int length) |
Deprecated.
|
void |
setURL(int parameterIndex,
java.net.URL x) |
|
private void |
writeDescribeInput(Section section) |
|
private void |
writeExecute(Section section,
ColumnMetaData parameterMetaData,
java.lang.Object[] inputs,
int numInputColumns,
boolean outputExpected,
boolean chainedWritesFollowingSetLob) |
|
private void |
writeOpenQuery(Section section,
int fetchSize,
int resultSetType,
int numInputColumns,
ColumnMetaData parameterMetaData,
java.lang.Object[] inputs) |
|
private void |
writePrepareDescribeInput() |
|
private void |
writePrepareDescribeInputOutput() |
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, writeSetSpecialRegisterclone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcancel, 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, setQueryTimeoutaccumulateWarning, completeExecute, completeExecuteCall, completeExecuteCall, completeExecuteCallOpenQuery, completeExecuteImmediate, completeExecuteSetStatement, completeOpenQuery, completePrepare, completePrepareDescribeOutput, completeSqlca, getConnectionCallbackInterface, getGuessedResultSetMetaDatapublic MaterialPreparedStatement materialPreparedStatement_
java.lang.String sql_
boolean outputRegistered_
java.lang.Object[] parameters_
private boolean[] parameterSet_
boolean[] parameterRegistered_
ColumnMetaData parameterMetaData_
private java.util.ArrayList<int[]> parameterTypeList
private java.lang.String positionedUpdateCursorName_
private final ClientPooledConnection pooledConnection_
private boolean listenToUnitOfWork_
public ClientPreparedStatement(Agent agent, ClientConnection connection, java.lang.String sql, Section section, ClientPooledConnection cpc) throws SqlException
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.SqlExceptionpublic ClientPreparedStatement(Agent agent, ClientConnection connection, java.lang.String sql, int type, int concurrency, int holdability, int autoGeneratedKeys, java.lang.String[] columnNames, int[] columnIndexes, ClientPooledConnection cpc) throws SqlException
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.SqlExceptionvoid setInput(int parameterIndex,
java.lang.Object input)
private void initPreparedStatement()
protected void initResetPreparedStatement()
initResetPreparedStatement in class ClientStatementpublic void reset(boolean fullReset)
throws SqlException
reset in class ClientStatementSqlExceptionvoid resetForReuse()
throws SqlException
resetForReuse in class ClientStatementSqlException - if the reset failsClientStatement.resetForReuse()private void resetParameters()
private void resetPreparedStatement(Agent agent, ClientConnection connection, java.lang.String sql, Section section) throws SqlException
SqlExceptionprivate void initPreparedStatement(java.lang.String sql,
Section section)
throws SqlException
SqlExceptionpublic void resetPreparedStatement(Agent agent, ClientConnection connection, java.lang.String sql, int type, int concurrency, int holdability, int autoGeneratedKeys, java.lang.String[] columnNames, int[] columnIndexes) throws SqlException
SqlExceptionprivate void initPreparedStatement(java.lang.String sql)
throws SqlException
SqlExceptionvoid prepare()
throws SqlException
SqlExceptionpublic void addBatch(java.lang.String sql)
throws java.sql.SQLException
addBatch in interface java.sql.StatementaddBatch in class ClientStatementjava.sql.SQLExceptionpublic boolean execute(java.lang.String sql)
throws java.sql.SQLException
execute in interface java.sql.Statementexecute in class ClientStatementjava.sql.SQLExceptionpublic java.sql.ResultSet executeQuery(java.lang.String sql)
throws java.sql.SQLException
executeQuery in interface java.sql.StatementexecuteQuery in class ClientStatementjava.sql.SQLExceptionpublic int executeUpdate(java.lang.String sql)
throws java.sql.SQLException
executeUpdate in interface java.sql.StatementexecuteUpdate in class ClientStatementjava.sql.SQLExceptionpublic java.sql.ResultSet executeQuery()
throws java.sql.SQLException
executeQuery in interface java.sql.PreparedStatementjava.sql.SQLExceptionClientResultSet executeQueryX() throws SqlException
SqlExceptionpublic int executeUpdate()
throws java.sql.SQLException
executeUpdate in interface java.sql.PreparedStatementjava.sql.SQLExceptionprivate long executeUpdateX()
throws SqlException
SqlExceptionpublic void setNull(int parameterIndex,
int jdbcType)
throws java.sql.SQLException
setNull in interface java.sql.PreparedStatementjava.sql.SQLExceptionvoid setNullX(int parameterIndex,
int jdbcType)
throws SqlException
SqlExceptionpublic void setNull(int parameterIndex,
int jdbcType,
java.lang.String typeName)
throws java.sql.SQLException
setNull in interface java.sql.PreparedStatementjava.sql.SQLExceptionpublic void setBoolean(int parameterIndex,
boolean x)
throws java.sql.SQLException
setBoolean in interface java.sql.PreparedStatementjava.sql.SQLExceptionpublic void setByte(int parameterIndex,
byte x)
throws java.sql.SQLException
setByte in interface java.sql.PreparedStatementjava.sql.SQLExceptionpublic void setShort(int parameterIndex,
short x)
throws java.sql.SQLException
setShort in interface java.sql.PreparedStatementjava.sql.SQLExceptionvoid setShortX(int parameterIndex,
short x)
throws SqlException
SqlExceptionpublic void setInt(int parameterIndex,
int x)
throws java.sql.SQLException
setInt in interface java.sql.PreparedStatementjava.sql.SQLExceptionvoid setIntX(int parameterIndex,
int x)
throws SqlException
SqlExceptionpublic void setLong(int parameterIndex,
long x)
throws java.sql.SQLException
setLong in interface java.sql.PreparedStatementjava.sql.SQLExceptionvoid setLongX(int parameterIndex,
long x)
public void setFloat(int parameterIndex,
float x)
throws java.sql.SQLException
setFloat in interface java.sql.PreparedStatementjava.sql.SQLExceptionpublic void setDouble(int parameterIndex,
double x)
throws java.sql.SQLException
setDouble in interface java.sql.PreparedStatementjava.sql.SQLExceptionpublic void setBigDecimal(int parameterIndex,
java.math.BigDecimal x)
throws java.sql.SQLException
setBigDecimal in interface java.sql.PreparedStatementjava.sql.SQLExceptionpublic void setDate(int parameterIndex,
java.sql.Date x,
java.util.Calendar calendar)
throws java.sql.SQLException
setDate in interface java.sql.PreparedStatementjava.sql.SQLExceptionpublic void setDate(int parameterIndex,
java.sql.Date x)
throws java.sql.SQLException
setDate in interface java.sql.PreparedStatementjava.sql.SQLExceptionpublic void setTime(int parameterIndex,
java.sql.Time x,
java.util.Calendar calendar)
throws java.sql.SQLException
setTime in interface java.sql.PreparedStatementjava.sql.SQLExceptionpublic void setTime(int parameterIndex,
java.sql.Time x)
throws java.sql.SQLException
setTime in interface java.sql.PreparedStatementjava.sql.SQLExceptionpublic void setTimestamp(int parameterIndex,
java.sql.Timestamp x,
java.util.Calendar calendar)
throws java.sql.SQLException
setTimestamp in interface java.sql.PreparedStatementjava.sql.SQLExceptionpublic void setTimestamp(int parameterIndex,
java.sql.Timestamp x)
throws java.sql.SQLException
setTimestamp in interface java.sql.PreparedStatementjava.sql.SQLExceptionpublic void setString(int parameterIndex,
java.lang.String x)
throws java.sql.SQLException
setString in interface java.sql.PreparedStatementjava.sql.SQLExceptionvoid setStringX(int parameterIndex,
java.lang.String x)
throws SqlException
SqlExceptionpublic void setBytes(int parameterIndex,
byte[] x)
throws java.sql.SQLException
setBytes in interface java.sql.PreparedStatementjava.sql.SQLExceptionvoid setBytesX(int parameterIndex,
byte[] x)
throws SqlException
SqlExceptionpublic void setBinaryStream(int parameterIndex,
java.io.InputStream x,
long length)
throws java.sql.SQLException
setBinaryStream in interface java.sql.PreparedStatementparameterIndex - 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 streamjava.sql.SQLException - thrown on failure.public void setBinaryStream(int parameterIndex,
java.io.InputStream x,
int length)
throws java.sql.SQLException
setBinaryStream in interface java.sql.PreparedStatementparameterIndex - 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 streamjava.sql.SQLException - thrown on failure.private void setBinaryStreamX(int parameterIndex,
java.io.InputStream x,
int length)
throws SqlException
SqlExceptionpublic void setAsciiStream(int parameterIndex,
java.io.InputStream x,
long length)
throws java.sql.SQLException
setAsciiStream in interface java.sql.PreparedStatementparameterIndex - 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 streamjava.sql.SQLException - thrown on failure.public void setAsciiStream(int parameterIndex,
java.io.InputStream x,
int length)
throws java.sql.SQLException
setAsciiStream in interface java.sql.PreparedStatementparameterIndex - 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 streamjava.sql.SQLException - thrown on failure.private void checkStreamLength(long length)
throws java.sql.SQLException
length - The length of the stream being setjava.sql.SQLException - Thrown for a negative or too large length.private void checkTypeForSetAsciiStream(int parameterIndex)
throws SqlException,
java.sql.SQLException
SqlExceptionjava.sql.SQLExceptionprivate void checkTypeForSetBinaryStream(int parameterIndex)
throws SqlException,
java.sql.SQLException
SqlExceptionjava.sql.SQLExceptionprivate void checkTypeForSetCharacterStream(int parameterIndex)
throws SqlException,
java.sql.SQLException
SqlExceptionjava.sql.SQLExceptionprivate void checkTypeForSetBlob(int parameterIndex)
throws SqlException,
java.sql.SQLException
SqlExceptionjava.sql.SQLExceptionprivate void checkTypeForSetClob(int parameterIndex)
throws SqlException,
java.sql.SQLException
SqlExceptionjava.sql.SQLExceptionpublic void setUnicodeStream(int parameterIndex,
java.io.InputStream x,
int length)
throws java.sql.SQLException
setUnicodeStream in interface java.sql.PreparedStatementparameterIndex - 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 streamjava.sql.SQLException - throws feature not implemented.public void setCharacterStream(int parameterIndex,
java.io.Reader x)
throws java.sql.SQLException
Reader object.
When a very large UNICODE value is input to a LONGVARCHAR parameter, it
may be more practical to send it via a java.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.setCharacterStream in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the java.io.Reader object that contains the
Unicode datajava.sql.SQLException - if a database access error occurs or this method is
called on a closed PreparedStatementpublic void setCharacterStream(int parameterIndex,
java.io.Reader x,
long length)
throws java.sql.SQLException
setCharacterStream in interface java.sql.PreparedStatementparameterIndex - 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 streamjava.sql.SQLException - thrown on failure.public void setCharacterStream(int parameterIndex,
java.io.Reader x,
int length)
throws java.sql.SQLException
setCharacterStream in interface java.sql.PreparedStatementparameterIndex - 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 streamjava.sql.SQLException - thrown on failure.public void setBlob(int parameterIndex,
java.sql.Blob x)
throws java.sql.SQLException
setBlob in interface java.sql.PreparedStatementjava.sql.SQLExceptionprivate void setBlobX(int parameterIndex,
java.sql.Blob x)
throws SqlException
SqlExceptionpublic void setClob(int parameterIndex,
java.sql.Clob x)
throws java.sql.SQLException
setClob in interface java.sql.PreparedStatementjava.sql.SQLExceptionprivate void setClobX(int parameterIndex,
java.sql.Clob x)
throws SqlException
SqlExceptionpublic void setArray(int parameterIndex,
java.sql.Array x)
throws java.sql.SQLException
setArray in interface java.sql.PreparedStatementjava.sql.SQLExceptionpublic void setRef(int parameterIndex,
java.sql.Ref x)
throws java.sql.SQLException
setRef in interface java.sql.PreparedStatementjava.sql.SQLExceptionpublic void setObject(int parameterIndex,
java.lang.Object x)
throws java.sql.SQLException
setObject in interface java.sql.PreparedStatementjava.sql.SQLExceptionprivate void setUDTX(int parameterIndex,
java.lang.Object x)
throws SqlException,
java.sql.SQLException
SqlExceptionjava.sql.SQLExceptionpublic void setObject(int parameterIndex,
java.lang.Object x,
int targetJdbcType)
throws java.sql.SQLException
setObject in interface java.sql.PreparedStatementjava.sql.SQLExceptionpublic void setObject(int parameterIndex,
java.lang.Object x,
int targetJdbcType,
int scale)
throws java.sql.SQLException
setObject in interface java.sql.PreparedStatementjava.sql.SQLExceptionprivate void setObjectX(int parameterIndex,
java.lang.Object x,
int targetJdbcType,
int scale)
throws SqlException
SqlExceptionpublic void clearParameters()
throws java.sql.SQLException
clearParameters in interface java.sql.PreparedStatementjava.sql.SQLExceptionpublic boolean execute()
throws java.sql.SQLException
execute in interface java.sql.PreparedStatementjava.sql.SQLExceptionboolean executeX()
throws SqlException
SqlExceptionpublic void addBatch()
throws java.sql.SQLException
addBatch in interface java.sql.PreparedStatementjava.sql.SQLExceptionpublic int[] executeBatch()
throws java.sql.SQLException
executeBatch in interface java.sql.StatementexecuteBatch in class ClientStatementjava.sql.SQLExceptionpublic java.sql.ResultSetMetaData getMetaData()
throws java.sql.SQLException
getMetaData in interface java.sql.PreparedStatementjava.sql.SQLExceptionprivate ColumnMetaData getMetaDataX() throws SqlException
SqlExceptionpublic boolean execute(java.lang.String sql,
int autoGeneratedKeys)
throws java.sql.SQLException
execute in interface java.sql.Statementexecute in class ClientStatementjava.sql.SQLExceptionpublic boolean execute(java.lang.String sql,
java.lang.String[] columnNames)
throws java.sql.SQLException
execute in interface java.sql.Statementexecute in class ClientStatementjava.sql.SQLExceptionpublic boolean execute(java.lang.String sql,
int[] columnIndexes)
throws java.sql.SQLException
execute in interface java.sql.Statementexecute in class ClientStatementjava.sql.SQLExceptionpublic int executeUpdate(java.lang.String sql,
int autoGeneratedKeys)
throws java.sql.SQLException
executeUpdate in interface java.sql.StatementexecuteUpdate in class ClientStatementjava.sql.SQLExceptionpublic int executeUpdate(java.lang.String sql,
java.lang.String[] columnNames)
throws java.sql.SQLException
executeUpdate in interface java.sql.StatementexecuteUpdate in class ClientStatementjava.sql.SQLExceptionpublic int executeUpdate(java.lang.String sql,
int[] columnIndexes)
throws java.sql.SQLException
executeUpdate in interface java.sql.StatementexecuteUpdate in class ClientStatementjava.sql.SQLExceptionpublic void setURL(int parameterIndex,
java.net.URL x)
throws java.sql.SQLException
setURL in interface java.sql.PreparedStatementjava.sql.SQLExceptionpublic java.sql.ParameterMetaData getParameterMetaData()
throws java.sql.SQLException
getParameterMetaData in interface java.sql.PreparedStatementjava.sql.SQLExceptionprivate ClientParameterMetaData getParameterMetaDataX() throws SqlException
SqlExceptionprivate ColumnMetaData getColumnMetaDataX() throws SqlException
SqlExceptionprivate void writeExecute(Section section, ColumnMetaData parameterMetaData, java.lang.Object[] inputs, int numInputColumns, boolean outputExpected, boolean chainedWritesFollowingSetLob) throws SqlException
SqlExceptionprivate void readExecute()
throws SqlException
SqlExceptionprivate void writeOpenQuery(Section section, int fetchSize, int resultSetType, int numInputColumns, ColumnMetaData parameterMetaData, java.lang.Object[] inputs) throws SqlException
SqlExceptionprivate void writeDescribeInput(Section section) throws SqlException
SqlExceptionprivate void readDescribeInput()
throws SqlException
SqlExceptionpublic void completeDescribeInput(ColumnMetaData parameterMetaData, Sqlca sqlca)
completeDescribeInput in interface PreparedStatementCallbackInterfacepublic void completeDescribeOutput(ColumnMetaData resultSetMetaData, Sqlca sqlca)
completeDescribeOutput in interface PreparedStatementCallbackInterfaceprivate void writePrepareDescribeInputOutput()
throws SqlException
SqlExceptionprivate void readPrepareDescribeInputOutput()
throws SqlException
SqlExceptionprivate void writePrepareDescribeInput()
throws SqlException
SqlExceptionprivate void readPrepareDescribeInput()
throws SqlException
SqlExceptionprivate void completePrepareDescribe()
private java.lang.Object[] expandObjectArray(java.lang.Object[] array,
int newLength)
private boolean[] expandBooleanArray(boolean[] array,
int newLength)
void flowPrepareDescribeInputOutput()
throws SqlException
SqlExceptionprivate void flowExecute(int executeType)
throws SqlException
SqlExceptionprivate long[] executeBatchX(boolean supportsQueryBatchRequest)
throws SqlException,
java.sql.SQLException
SqlExceptionjava.sql.SQLExceptionprivate long[] executeBatchRequestX(boolean supportsQueryBatchRequest)
throws SqlException,
java.sql.BatchUpdateException
SqlExceptionjava.sql.BatchUpdateExceptionpublic void listenToUnitOfWork()
listenToUnitOfWork in interface UnitOfWorkListenerlistenToUnitOfWork in class ClientStatementpublic void completeLocalCommit(java.util.Iterator listenerIterator)
completeLocalCommit in interface UnitOfWorkListenercompleteLocalCommit in class ClientStatementpublic void completeLocalRollback(java.util.Iterator listenerIterator)
completeLocalRollback in interface UnitOfWorkListenercompleteLocalRollback in class ClientStatementprotected java.lang.String getJdbcStatementInterfaceName()
getJdbcStatementInterfaceName in class ClientStatementvoid checkForValidParameterIndex(int parameterIndex)
throws SqlException
SqlExceptionprivate void checkThatAllParametersAreSet()
throws SqlException
SqlExceptionvoid checkForValidScale(int scale)
throws SqlException
SqlExceptionprotected void markClosed(boolean removeListener)
ClientStatementmarkClosed in class ClientStatementremoveListener - 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.public void setAsciiStream(int parameterIndex,
java.io.InputStream x)
throws java.sql.SQLException
LONGVARCHAR
parameter, it may be more practical to send it via a
java.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.setAsciiStream in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the Java input stream that contains the ASCII parameter valuejava.sql.SQLException - if a database access error occurs or this method is
called on a closed PreparedStatementpublic void setBinaryStream(int parameterIndex,
java.io.InputStream x)
throws java.sql.SQLException
LONGVARBINARY
parameter, it may be more practical to send it via a
java.io.InputStream object. The data will be read from the
stream as needed until end-of-file is reached.setBinaryStream in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the java input stream which contains the binary parameter valuejava.sql.SQLException - if a database access error occurs or this method is
called on a closed PreparedStatementpublic void setClob(int parameterIndex,
java.io.Reader reader)
throws java.sql.SQLException
Reader object.setClob in interface java.sql.PreparedStatementparameterIndex - index of the first parameter is 1, the second is
2, ...reader - an object that contains the data to set the parameter
value to.java.sql.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
statementpublic void setClob(int parameterIndex,
java.io.Reader reader,
long length)
throws java.sql.SQLException
setClob in interface java.sql.PreparedStatementparameterIndex - 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.java.sql.SQLException - if parameterIndex does not correspond to a parameter
marker in the SQL statement, or if the length specified is less than zero.public void setBlob(int parameterIndex,
java.io.InputStream inputStream)
throws java.sql.SQLException
InputStream object.
This method differs from the setBinaryStream(int, InputStream)
method because it informs the driver that the parameter value
should be sent to the server as a BLOB. When the
setBinaryStream method is used, the driver may have to do
extra work to determine whether the parameter data should be sent to the
server as a LONGVARBINARY or a BLOBsetBlob in interface java.sql.PreparedStatementparameterIndex - index of the first parameter is 1, the second is
2, ...inputStream - an object that contains the data to set the parameter
value to.java.sql.SQLException - if a database access error occurs, this method is
called on a closed PreparedStatement or if
parameterIndex does not correspond to a parameter
marker in the SQL statementpublic void setBlob(int parameterIndex,
java.io.InputStream inputStream,
long length)
throws java.sql.SQLException
setBlob in interface java.sql.PreparedStatementparameterIndex - 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.java.sql.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.public void setNString(int index,
java.lang.String value)
throws java.sql.SQLException
setNString in interface java.sql.PreparedStatementjava.sql.SQLExceptionpublic void setNCharacterStream(int parameterIndex,
java.io.Reader value)
throws java.sql.SQLException
setNCharacterStream in interface java.sql.PreparedStatementjava.sql.SQLExceptionpublic void setNCharacterStream(int index,
java.io.Reader value,
long length)
throws java.sql.SQLException
setNCharacterStream in interface java.sql.PreparedStatementjava.sql.SQLExceptionpublic void setNClob(int parameterIndex,
java.io.Reader reader)
throws java.sql.SQLException
setNClob in interface java.sql.PreparedStatementjava.sql.SQLExceptionpublic void setNClob(int parameterIndex,
java.io.Reader reader,
long length)
throws java.sql.SQLException
setNClob in interface java.sql.PreparedStatementjava.sql.SQLExceptionpublic void setRowId(int parameterIndex,
java.sql.RowId x)
throws java.sql.SQLException
setRowId in interface java.sql.PreparedStatementjava.sql.SQLExceptionpublic void setNClob(int index,
java.sql.NClob value)
throws java.sql.SQLException
setNClob in interface java.sql.PreparedStatementjava.sql.SQLExceptionpublic void setSQLXML(int parameterIndex,
java.sql.SQLXML xmlObject)
throws java.sql.SQLException
setSQLXML in interface java.sql.PreparedStatementjava.sql.SQLExceptionpublic long executeLargeUpdate()
throws java.sql.SQLException
executeLargeUpdate in interface java.sql.PreparedStatementjava.sql.SQLExceptionprivate void checkStatementValidity(SqlException sqle) throws java.sql.SQLException
java.sql.SQLExceptionprotected void checkStatus()
throws java.sql.SQLException
Check for closed statement and extract the SQLException if it is raised.
java.sql.SQLExceptionApache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.