|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.derby.client.am.Statement
org.apache.derby.client.am.PreparedStatement
public class PreparedStatement
| Nested Class Summary | |
|---|---|
private static class |
PreparedStatement.PossibleTypes
PossibleTypes is information which is set of types. |
| Field Summary | |
|---|---|
(package private) boolean |
listenToUnitOfWork_
|
MaterialPreparedStatement |
materialPreparedStatement_
|
boolean |
outputRegistered_
|
ColumnMetaData |
parameterMetaData_
|
(package private) boolean[] |
parameterRegistered_
|
java.lang.Object[] |
parameters_
|
(package private) boolean[] |
parameterSet_
|
private java.util.ArrayList |
parameterTypeList
|
protected ClientPooledConnection |
pooledConnection_
|
(package private) java.lang.String |
positionedUpdateCursorName_
|
java.lang.String |
sql_
|
| 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 | |
|---|---|
PreparedStatement(Agent agent,
Connection 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. |
|
PreparedStatement(Agent agent,
Connection connection,
java.lang.String sql,
Section section,
ClientPooledConnection cpc)
The PreparedStatement constructor used for JDBC 2 positioned update statements. |
|
| Method Summary | |
|---|---|
void |
addBatch()
|
private void |
checkForSupportedDataType(int dataType)
Checks whether a data type is supported for setObject(int, Object, int) and
setObject(int, Object, int, int). |
(package private) void |
checkForValidParameterIndex(int parameterIndex)
|
(package private) void |
checkForValidScale(int scale)
|
(package private) void |
checkScaleForINOUTDecimal(int parameterIndex,
int registerOutScale)
|
private void |
checkStatementValidity(SqlException sqle)
|
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)
|
(package 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 int[] |
executeBatchRequestX(boolean supportsQueryBatchRequest)
|
int[] |
executeBatchX(boolean supportsQueryBatchRequest)
|
java.sql.ResultSet |
executeQuery()
|
java.sql.ResultSet |
executeQuery(java.lang.String sql)
|
(package private) ResultSet |
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 int |
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 ParameterMetaData |
getParameterMetaDataX()
|
private void |
initPreparedStatement()
|
private void |
initPreparedStatement(ColumnMetaData parameterMetaData,
ColumnMetaData resultSetMetaData)
|
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()
|
void |
readDescribeInput()
|
void |
readDescribeOutput()
|
void |
readExecute()
|
(package private) void |
readPrepareDescribeInput()
|
(package 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,
Connection connection,
java.lang.String sql,
int type,
int concurrency,
int holdability,
int autoGeneratedKeys,
java.lang.String[] columnNames,
int[] columnIndexes)
|
void |
resetPreparedStatement(Agent agent,
Connection connection,
java.lang.String sql,
Section section)
|
void |
resetPreparedStatement(Agent agent,
Connection connection,
java.lang.String sql,
Section section,
ColumnMetaData parameterMetaData,
ColumnMetaData resultSetMetaData)
|
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 |
protected void |
setBinaryStreamX(int parameterIndex,
java.io.InputStream x,
int length)
|
void |
setBlob(int parameterIndex,
java.sql.Blob x)
|
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 |
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)
|
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.sql.Clob x)
|
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. |
(package 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 |
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 |
setShort(int parameterIndex,
short x)
|
(package private) void |
setShortX(int parameterIndex,
short x)
|
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)
|
void |
setUnicodeStream(int parameterIndex,
java.io.InputStream x,
int length)
Deprecated. |
void |
setURL(int parameterIndex,
java.net.URL x)
|
void |
writeDescribeInput(Section section)
|
void |
writeDescribeOutput(Section section)
|
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)
|
(package private) void |
writePrepareDescribeInput()
|
(package private) void |
writePrepareDescribeInputOutput()
|
(package private) void |
writePrepareDescribeInputOutput(java.lang.String sql,
Section section)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.sql.PreparedStatement |
|---|
setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setRowId, setSQLXML |
| Methods inherited from interface java.sql.Statement |
|---|
addBatch, cancel, clearBatch, clearWarnings, close, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isPoolable, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout |
| Methods inherited from interface java.sql.Wrapper |
|---|
isWrapperFor, unwrap |
| Methods inherited from interface org.apache.derby.client.am.StatementCallbackInterface |
|---|
accumulateWarning, completeExecute, completeExecuteCall, completeExecuteCall, completeExecuteCallOpenQuery, completeExecuteImmediate, completeExecuteSetStatement, completeOpenQuery, completePrepare, completePrepareDescribeOutput, completeSqlca, getConnectionCallbackInterface, getGuessedResultSetMetaData |
| Field Detail |
|---|
public MaterialPreparedStatement materialPreparedStatement_
public java.lang.String sql_
public boolean outputRegistered_
public java.lang.Object[] parameters_
boolean[] parameterSet_
boolean[] parameterRegistered_
public ColumnMetaData parameterMetaData_
private java.util.ArrayList parameterTypeList
java.lang.String positionedUpdateCursorName_
protected final ClientPooledConnection pooledConnection_
boolean listenToUnitOfWork_
| Constructor Detail |
|---|
public PreparedStatement(Agent agent,
Connection 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.
SqlException
public PreparedStatement(Agent agent,
Connection 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.
SqlException| Method Detail |
|---|
void setInput(int parameterIndex,
java.lang.Object input)
private void initPreparedStatement()
protected void initResetPreparedStatement()
initResetPreparedStatement in class Statement
public void reset(boolean fullReset)
throws SqlException
reset in class StatementSqlException
void resetForReuse()
throws SqlException
resetForReuse in class StatementSqlException - if the reset failsStatement.resetForReuse()private void resetParameters()
public void resetPreparedStatement(Agent agent,
Connection connection,
java.lang.String sql,
Section section)
throws SqlException
SqlException
private void initPreparedStatement(java.lang.String sql,
Section section)
throws SqlException
SqlException
public void resetPreparedStatement(Agent agent,
Connection connection,
java.lang.String sql,
int type,
int concurrency,
int holdability,
int autoGeneratedKeys,
java.lang.String[] columnNames,
int[] columnIndexes)
throws SqlException
SqlException
private void initPreparedStatement(java.lang.String sql)
throws SqlException
SqlException
public void resetPreparedStatement(Agent agent,
Connection connection,
java.lang.String sql,
Section section,
ColumnMetaData parameterMetaData,
ColumnMetaData resultSetMetaData)
throws SqlException
SqlException
private void initPreparedStatement(ColumnMetaData parameterMetaData,
ColumnMetaData resultSetMetaData)
throws SqlException
SqlException
void prepare()
throws SqlException
SqlException
public boolean execute(java.lang.String sql)
throws java.sql.SQLException
execute in interface java.sql.Statementexecute in class Statementjava.sql.SQLException
public java.sql.ResultSet executeQuery(java.lang.String sql)
throws java.sql.SQLException
executeQuery in interface java.sql.StatementexecuteQuery in class Statementjava.sql.SQLException
public int executeUpdate(java.lang.String sql)
throws java.sql.SQLException
executeUpdate in interface java.sql.StatementexecuteUpdate in class Statementjava.sql.SQLException
public java.sql.ResultSet executeQuery()
throws java.sql.SQLException
executeQuery in interface java.sql.PreparedStatementjava.sql.SQLException
ResultSet executeQueryX()
throws SqlException
SqlException
public int executeUpdate()
throws java.sql.SQLException
executeUpdate in interface java.sql.PreparedStatementjava.sql.SQLException
private int executeUpdateX()
throws SqlException
SqlException
public void setNull(int parameterIndex,
int jdbcType)
throws java.sql.SQLException
setNull in interface java.sql.PreparedStatementjava.sql.SQLException
void setNullX(int parameterIndex,
int jdbcType)
throws SqlException
SqlException
public void setNull(int parameterIndex,
int jdbcType,
java.lang.String typeName)
throws java.sql.SQLException
setNull in interface java.sql.PreparedStatementjava.sql.SQLException
public void setBoolean(int parameterIndex,
boolean x)
throws java.sql.SQLException
setBoolean in interface java.sql.PreparedStatementjava.sql.SQLException
public void setByte(int parameterIndex,
byte x)
throws java.sql.SQLException
setByte in interface java.sql.PreparedStatementjava.sql.SQLException
public void setShort(int parameterIndex,
short x)
throws java.sql.SQLException
setShort in interface java.sql.PreparedStatementjava.sql.SQLException
void setShortX(int parameterIndex,
short x)
throws SqlException
SqlException
public void setInt(int parameterIndex,
int x)
throws java.sql.SQLException
setInt in interface java.sql.PreparedStatementjava.sql.SQLException
void setIntX(int parameterIndex,
int x)
throws SqlException
SqlException
public void setLong(int parameterIndex,
long x)
throws java.sql.SQLException
setLong in interface java.sql.PreparedStatementjava.sql.SQLException
void setLongX(int parameterIndex,
long x)
public void setFloat(int parameterIndex,
float x)
throws java.sql.SQLException
setFloat in interface java.sql.PreparedStatementjava.sql.SQLException
public void setDouble(int parameterIndex,
double x)
throws java.sql.SQLException
setDouble in interface java.sql.PreparedStatementjava.sql.SQLException
public void setBigDecimal(int parameterIndex,
java.math.BigDecimal x)
throws java.sql.SQLException
setBigDecimal in interface java.sql.PreparedStatementjava.sql.SQLException
public void setDate(int parameterIndex,
java.sql.Date x)
throws java.sql.SQLException
setDate in interface java.sql.PreparedStatementjava.sql.SQLException
public void setDate(int parameterIndex,
java.sql.Date x,
java.util.Calendar&n