public class BrokeredPreparedStatement extends BrokeredStatement implements EnginePreparedStatement
| Modifier and Type | Field and Description |
|---|---|
private java.lang.Object |
generatedKeys
An Integer, an int array or a String array that specifies generated
key columns, or null if there are no generated key columns.
|
(package private) java.lang.String |
sql
SQL used to create me.
|
control, resultSetConcurrency, resultSetHoldability, resultSetType| Constructor and Description |
|---|
BrokeredPreparedStatement(BrokeredStatementControl control,
java.lang.String sql,
java.lang.Object generatedKeys) |
| Modifier and Type | Method and Description |
|---|---|
void |
addBatch()
JDBC 2.0
Add a set of parameters to the batch.
|
void |
clearParameters()
In general, parameter values remain in force for repeated use of a
Statement.
|
void |
close()
In many cases, it is desirable to immediately release a
Statements's database and JDBC resources instead of waiting for
this to happen when it is automatically closed; the close
method provides this immediate release.
|
java.sql.PreparedStatement |
createDuplicateStatement(java.sql.Connection conn,
java.sql.PreparedStatement oldStatement)
Create a duplicate PreparedStatement to this, including state, from the passed in Connection.
|
boolean |
execute() |
long |
executeLargeUpdate() |
java.sql.ResultSet |
executeQuery()
A prepared SQL query is executed and its ResultSet is returned.
|
int |
executeUpdate()
Execute a SQL INSERT, UPDATE or DELETE statement.
|
java.sql.ResultSetMetaData |
getMetaData()
JDBC 2.0
The number, types and properties of a ResultSet's columns
are provided by the getMetaData method.
|
java.sql.ParameterMetaData |
getParameterMetaData() |
(package private) java.sql.PreparedStatement |
getPreparedStatement()
Access the underlying PreparedStatement.
|
java.sql.Statement |
getStatement()
Override the BrokeredStatement's getStatement() to always return a PreparedStatement.
|
long |
getVersionCounter()
Get the version of the prepared statement.
|
void |
setArray(int i,
java.sql.Array x) |
void |
setAsciiStream(int parameterIndex,
java.io.InputStream x,
int length)
We do this inefficiently and read it all in here.
|
void |
setBigDecimal(int parameterIndex,
java.math.BigDecimal x)
Set a parameter to a java.math.BigDecimal value.
|
void |
setBinaryStream(int parameterIndex,
java.io.InputStream x) |
void |
setBinaryStream(int parameterIndex,
java.io.InputStream x,
int length) |
void |
setBlob(int i,
java.sql.Blob x) |
void |
setBoolean(int parameterIndex,
boolean x)
Set a parameter to a Java boolean value.
|
void |
setByte(int parameterIndex,
byte x)
Set a parameter to a Java byte value.
|
void |
setBytes(int parameterIndex,
byte[] x)
Set a parameter to a Java array of bytes.
|
void |
setCharacterStream(int parameterIndex,
java.io.Reader reader) |
void |
setCharacterStream(int parameterIndex,
java.io.Reader reader,
int length) |
void |
setClob(int i,
java.sql.Clob x) |
void |
setDate(int parameterIndex,
java.sql.Date x)
Set a parameter to a java.sql.Date value.
|
void |
setDate(int i,
java.sql.Date x,
java.util.Calendar cal) |
void |
setDouble(int parameterIndex,
double x)
Set a parameter to a Java double value.
|
void |
setFloat(int parameterIndex,
float x)
Set a parameter to a Java float value.
|
void |
setInt(int parameterIndex,
int x)
Set a parameter to a Java int value.
|
void |
setLong(int parameterIndex,
long x)
Set a parameter to a Java long value.
|
void |
setNull(int parameterIndex,
int sqlType)
Set a parameter to SQL NULL.
|
void |
setNull(int parameterIndex,
int sqlType,
java.lang.String typeName)
Set a parameter to SQL NULL.
|
void |
setObject(int parameterIndex,
java.lang.Object x)
Set the value of a parameter using an object; use the
java.lang equivalent objects for integral values.
|
void |
setObject(int parameterIndex,
java.lang.Object x,
int targetSqlType)
This method is like setObject above, but assumes a scale of zero.
|
void |
setObject(int parameterIndex,
java.lang.Object x,
int targetSqlType,
int scale)
The interface says that the type of the Object parameter must
be compatible with the type of the targetSqlType.
|
void |
setRef(int i,
java.sql.Ref x) |
void |
setShort(int parameterIndex,
short x)
Set a parameter to a Java short value.
|
void |
setString(int parameterIndex,
java.lang.String x)
Set a parameter to a Java String value.
|
void |
setTime(int parameterIndex,
java.sql.Time x)
Set a parameter to a java.sql.Time value.
|
void |
setTime(int i,
java.sql.Time x,
java.util.Calendar cal) |
void |
setTimestamp(int parameterIndex,
java.sql.Timestamp x)
Set a parameter to a java.sql.Timestamp value.
|
void |
setTimestamp(int i,
java.sql.Timestamp x,
java.util.Calendar cal) |
void |
setUnicodeStream(int parameterIndex,
java.io.InputStream x,
int length)
Deprecated.
|
void |
setURL(int i,
java.net.URL x) |
addBatch, cancel, checkIfClosed, clearBatch, clearWarnings, closeOnCompletion, controlCheck, createDuplicateStatement, execute, execute, execute, execute, executeBatch, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getLargeMaxRows, getLargeUpdateCount, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isWrapperFor, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setQueryTimeout, setStatementState, unableToUnwrap, unwrap, wrapResultSetclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsetAsciiStream, setAsciiStream, setBinaryStream, setBlob, setBlob, setCharacterStream, setClob, setClob, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setObject, setObject, setRowId, setSQLXMLcloseOnCompletion, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, getLargeMaxRows, getLargeUpdateCount, getMoreResults, getResultSetHoldability, isClosed, isCloseOnCompletion, setLargeMaxRowsaddBatch, cancel, clearBatch, clearWarnings, execute, execute, execute, execute, executeBatch, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetType, getUpdateCount, getWarnings, isPoolable, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeoutfinal java.lang.String sql
private final java.lang.Object generatedKeys
public BrokeredPreparedStatement(BrokeredStatementControl control, java.lang.String sql, java.lang.Object generatedKeys) throws java.sql.SQLException
java.sql.SQLExceptionpublic final java.sql.ResultSet executeQuery()
throws java.sql.SQLException
executeQuery in interface java.sql.PreparedStatementjava.sql.SQLException - thrown on failure.public final int executeUpdate()
throws java.sql.SQLException
executeUpdate in interface java.sql.PreparedStatementjava.sql.SQLException - thrown on failure.public void close()
throws java.sql.SQLException
BrokeredStatementNote: A Statement is automatically closed when it is garbage collected. When a Statement is closed its current ResultSet, if one exists, is also closed.
close in interface java.lang.AutoCloseableclose in interface java.sql.Statementclose in class BrokeredStatementjava.sql.SQLException - thrown on failure.public final void setNull(int parameterIndex,
int sqlType)
throws java.sql.SQLException
Note: You must specify the parameter's SQL type.
setNull in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...sqlType - SQL type code defined by java.sql.Typesjava.sql.SQLException - thrown on failure.public final void setNull(int parameterIndex,
int sqlType,
java.lang.String typeName)
throws java.sql.SQLException
Note: You must specify the parameter's SQL type.
setNull in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...sqlType - SQL type code defined by java.sql.Typesjava.sql.SQLException - thrown on failure.public final void setBoolean(int parameterIndex,
boolean x)
throws java.sql.SQLException
setBoolean in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the parameter valuejava.sql.SQLException - thrown on failure.public final void setByte(int parameterIndex,
byte x)
throws java.sql.SQLException
setByte in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the parameter valuejava.sql.SQLException - thrown on failure.public final void setShort(int parameterIndex,
short x)
throws java.sql.SQLException
setShort in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the parameter valuejava.sql.SQLException - thrown on failure.public final void setInt(int parameterIndex,
int x)
throws java.sql.SQLException
setInt in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the parameter valuejava.sql.SQLException - thrown on failure.public final void setLong(int parameterIndex,
long x)
throws java.sql.SQLException
setLong in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the parameter valuejava.sql.SQLException - thrown on failure.public final void setFloat(int parameterIndex,
float x)
throws java.sql.SQLException
setFloat in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the parameter valuejava.sql.SQLException - thrown on failure.public final void setDouble(int parameterIndex,
double x)
throws java.sql.SQLException
setDouble in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the parameter valuejava.sql.SQLException - thrown on failure.public final void setBigDecimal(int parameterIndex,
java.math.BigDecimal x)
throws java.sql.SQLException
setBigDecimal in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the parameter valuejava.sql.SQLException - thrown on failure.public final void setString(int parameterIndex,
java.lang.String x)
throws java.sql.SQLException
setString in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the parameter valuejava.sql.SQLException - thrown on failure.public final void setBytes(int parameterIndex,
byte[] x)
throws java.sql.SQLException
setBytes in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the parameter valuejava.sql.SQLException - thrown on failure.public final void setDate(int parameterIndex,
java.sql.Date x)
throws java.sql.SQLException
setDate in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the parameter valuejava.sql.SQLException - thrown on failure.public final void setTime(int parameterIndex,
java.sql.Time x)
throws java.sql.SQLException
setTime in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the parameter valuejava.sql.SQLException - thrown on failure.public final void setTimestamp(int parameterIndex,
java.sql.Timestamp x)
throws java.sql.SQLException
setTimestamp in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the parameter valuejava.sql.SQLException - thrown on failure.public final 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.public final 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 - thrown on failure.public final 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.public final void addBatch()
throws java.sql.SQLException
addBatch in interface java.sql.PreparedStatementjava.sql.SQLException - if a database-access error occurs.public final void clearParameters()
throws java.sql.SQLException
In general, parameter values remain in force for repeated use of a Statement. Setting a parameter value automatically clears its previous value. However, in some cases it is useful to immediately release the resources used by the current parameter values; this can be done by calling clearParameters.
clearParameters in interface java.sql.PreparedStatementjava.sql.SQLException - thrown on failure.public final java.sql.ResultSetMetaData getMetaData()
throws java.sql.SQLException
getMetaData in interface java.sql.PreparedStatementjava.sql.SQLException - Feature not implemented for now.public final void setObject(int parameterIndex,
java.lang.Object x,
int targetSqlType,
int scale)
throws java.sql.SQLException
If x is null, it won't tell us its type, so we pass it on to setNull
setObject in interface java.sql.PreparedStatementparameterIndex - The first parameter is 1, the second is 2, ...x - The object containing the input parameter valuetargetSqlType - The SQL type (as defined in java.sql.Types) to be
sent to the database. The scale argument may further qualify this type.scale - For java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types
this is the number of digits after the decimal. For all other
types this value will be ignored,java.sql.SQLException - thrown on failure.public final void setObject(int parameterIndex,
java.lang.Object x,
int targetSqlType)
throws java.sql.SQLException
setObject in interface java.sql.PreparedStatementjava.sql.SQLException - thrown on failure.public final void setObject(int parameterIndex,
java.lang.Object x)
throws java.sql.SQLException
Set the value of a parameter using an object; use the java.lang equivalent objects for integral values.
The JDBC specification specifies a standard mapping from Java Object types to SQL types. The given argument java object will be converted to the corresponding SQL type before being sent to the database.
Note that this method may be used to pass datatabase specific abstract data types, by using a Driver specific Java type.
setObject in interface java.sql.PreparedStatementparameterIndex - The first parameter is 1, the second is 2, ...x - The object containing the input parameter valuejava.sql.SQLException - thrown on failure.public final boolean execute()
throws java.sql.SQLException
execute in interface java.sql.PreparedStatementjava.sql.SQLException - thrown on failure.Statement.execute(java.lang.String)public final void setCharacterStream(int parameterIndex,
java.io.Reader reader,
int length)
throws java.sql.SQLException
setCharacterStream in interface java.sql.PreparedStatementjava.sql.SQLExceptionpublic final void setRef(int i,
java.sql.Ref x)
throws java.sql.SQLException
setRef in interface java.sql.PreparedStatementjava.sql.SQLExceptionpublic final void setBlob(int i,
java.sql.Blob x)
throws java.sql.SQLException
setBlob in interface java.sql.PreparedStatementjava.sql.SQLExceptionpublic final void setClob(int i,
java.sql.Clob x)
throws java.sql.SQLException
setClob in interface java.sql.PreparedStatementjava.sql.SQLExceptionpublic final void setArray(int i,
java.sql.Array x)
throws java.sql.SQLException
setArray in interface java.sql.PreparedStatementjava.sql.SQLExceptionpublic final void setDate(int i,
java.sql.Date x,
java.util.Calendar cal)
throws java.sql.SQLException
setDate in interface java.sql.PreparedStatementjava.sql.SQLExceptionpublic final void setTime(int i,
java.sql.Time x,
java.util.Calendar cal)
throws java.sql.SQLException
setTime in interface java.sql.PreparedStatementjava.sql.SQLExceptionpublic final void setTimestamp(int i,
java.sql.Timestamp x,
java.util.Calendar cal)
throws java.sql.SQLException
setTimestamp in interface java.sql.PreparedStatementjava.sql.SQLExceptionpublic long executeLargeUpdate()
throws java.sql.SQLException
executeLargeUpdate in interface java.sql.PreparedStatementexecuteLargeUpdate in interface EnginePreparedStatementjava.sql.SQLExceptionpublic void setBinaryStream(int parameterIndex,
java.io.InputStream x)
throws java.sql.SQLException
setBinaryStream in interface java.sql.PreparedStatementsetBinaryStream in interface EnginePreparedStatementjava.sql.SQLExceptionpublic void setCharacterStream(int parameterIndex,
java.io.Reader reader)
throws java.sql.SQLException
setCharacterStream in interface java.sql.PreparedStatementsetCharacterStream in interface EnginePreparedStatementjava.sql.SQLExceptionpublic final void setURL(int i,
java.net.URL x)
throws java.sql.SQLException
setURL in interface java.sql.PreparedStatementjava.sql.SQLExceptionpublic final java.sql.ParameterMetaData getParameterMetaData()
throws java.sql.SQLException
getParameterMetaData in interface java.sql.PreparedStatementjava.sql.SQLExceptionjava.sql.PreparedStatement getPreparedStatement()
throws java.sql.SQLException
java.sql.SQLExceptionpublic final java.sql.Statement getStatement()
throws java.sql.SQLException
getStatement in class BrokeredStatementjava.sql.SQLExceptionpublic java.sql.PreparedStatement createDuplicateStatement(java.sql.Connection conn,
java.sql.PreparedStatement oldStatement)
throws java.sql.SQLException
java.sql.SQLExceptionpublic final long getVersionCounter()
throws java.sql.SQLException
EnginePreparedStatementgetVersionCounter in interface EnginePreparedStatementjava.sql.SQLExceptionApache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.