Top Description Fields Constructors Methods
org.apache.derby.iapi.jdbc

public Class BrokeredPreparedStatement

extends BrokeredStatement
implements EnginePreparedStatement
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.jdbc.EnginePreparedStatement, org.apache.derby.iapi.jdbc.EngineStatement, java.sql.Statement, java.lang.AutoCloseable, java.sql.Wrapper, java.sql.PreparedStatement
Known Direct Subclasses
org.apache.derby.iapi.jdbc.BrokeredPreparedStatement42, org.apache.derby.iapi.jdbc.BrokeredCallableStatement
Imports
java.io.InputStream, .Reader, java.net.URL, java.sql.*, java.util.Calendar

A brokered PreparedStatement that forwards calls off to a real PreparedStatement obtained through the BrokeredStatementControl#getRealPreparedStatement method. This class implements the JDBC 4.1 interface.

Field Summary

Modifier and TypeField and Description
private final 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.

pack-priv final String
sql

SQL used to create me.

Inherited from org.apache.derby.iapi.jdbc.BrokeredStatement:
controlresultSetConcurrencyresultSetHoldabilityresultSetType

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public final void
addBatch()

Implements java.sql.PreparedStatement.addBatch.

JDBC 2.0 Add a set of parameters to the batch.

public final void
clearParameters()

Implements java.sql.PreparedStatement.clearParameters.

In general, parameter values remain in force for repeated use of a Statement.

public void
close()

Overrides org.apache.derby.iapi.jdbc.BrokeredStatement.close.

Implements java.sql.Statement.close.

Releases this Statement object's database and JDBC resources immediately instead of waiting for this to happen when it is automatically closed.

public PreparedStatement

Returns:

a new PreparedStatement
createDuplicateStatement
(Connection
The current connection
conn
,
PreparedStatement
The old statement
oldStatement
)

Create a duplicate PreparedStatement to this, including state, from the passed in Connection.

public final boolean
execute()

Implements java.sql.PreparedStatement.execute.

Executes the SQL statement in this PreparedStatement object, which may be any kind of SQL statement.

public long
executeLargeUpdate()

Implements org.apache.derby.iapi.jdbc.EnginePreparedStatement.executeLargeUpdate.

Executes the SQL statement in this PreparedStatement object, which must be an SQL Data Manipulation Language (DML) statement, such as INSERT, UPDATE or DELETE; or an SQL statement that returns nothing, such as a DDL statement.

public final ResultSet

Returns:

a ResultSet that contains the data produced by the query; never null
executeQuery
()

Implements java.sql.PreparedStatement.executeQuery.

A prepared SQL query is executed and its ResultSet is returned.

public final int

Returns:

either the row count for INSERT, UPDATE or DELETE; or 0 for SQL statements that return nothing
executeUpdate
()

Implements java.sql.PreparedStatement.executeUpdate.

Execute a SQL INSERT, UPDATE or DELETE statement.

public final ResultSetMetaData

Returns:

the description of a ResultSet's columns
getMetaData
()

Implements java.sql.PreparedStatement.getMetaData.

JDBC 2.0 The number, types and properties of a ResultSet's columns are provided by the getMetaData method.

public final ParameterMetaData
getParameterMetaData()

Implements java.sql.PreparedStatement.getParameterMetaData.

Retrieves the number, types and properties of this PreparedStatement object's parameters.

pack-priv PreparedStatement
getPreparedStatement()

Access the underlying PreparedStatement.

public final Statement
getStatement()

Overrides org.apache.derby.iapi.jdbc.BrokeredStatement.getStatement.

Override the BrokeredStatement's getStatement() to always return a PreparedStatement.

public final long
getVersionCounter()

Implements org.apache.derby.iapi.jdbc.EnginePreparedStatement.getVersionCounter.

Get the version of the prepared statement.

public final void
setArray(int
the first parameter is 1, the second is 2, ...
i
,
Array
an Array object that maps an SQL ARRAY value
x
)

Implements java.sql.PreparedStatement.setArray.

Sets the designated parameter to the given java.sql.Array object.

public final void
setAsciiStream(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
InputStream
the java input stream which contains the ASCII parameter value
x
,
int
the number of bytes in the stream
length
)

Implements java.sql.PreparedStatement.setAsciiStream.

We do this inefficiently and read it all in here.

public final void
setAsciiStream(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
InputStream
the Java input stream that contains the ASCII parameter value
x
)

Implements java.sql.PreparedStatement.setAsciiStream.

Sets the designated parameter to the given input stream.

public final void
setAsciiStream(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
InputStream
the java input stream which contains the ASCII parameter value
x
,
long
the number of bytes in the stream
length
)

Implements java.sql.PreparedStatement.setAsciiStream.

Sets the designated parameter to the given input stream, which will have the specified number of bytes.

public final void
setBigDecimal(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
BigDecimal
the parameter value
x
)

Implements java.sql.PreparedStatement.setBigDecimal.

Set a parameter to a java.math.BigDecimal value.

public final void
setBinaryStream(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
InputStream
the java input stream which contains the binary parameter value
x
,
int
the number of bytes in the stream
length
)

Implements java.sql.PreparedStatement.setBinaryStream.

Sets the designated parameter to the given input stream, which will have the specified number of bytes.

public void
setBinaryStream(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
InputStream
the java input stream which contains the binary parameter value
x
)

Implements java.sql.PreparedStatement.setBinaryStream.

Sets the designated parameter to the given input stream.

public final void
setBinaryStream(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
InputStream
the java input stream which contains the binary parameter value
x
,
long
the number of bytes in the stream
length
)

Implements java.sql.PreparedStatement.setBinaryStream.

Sets the designated parameter to the given input stream, which will have the specified number of bytes.

public final void
setBlob(int
the first parameter is 1, the second is 2, ...
i
,
Blob
a Blob object that maps an SQL BLOB value
x
)

Implements java.sql.PreparedStatement.setBlob.

Sets the designated parameter to the given java.sql.Blob object.

public final void
setBlob(int
index of the first parameter is 1, the second is 2, ...
parameterIndex
,
InputStream
An object that contains the data to set the parameter value to.
inputStream
,
long
the number of bytes in the parameter data.
length
)

Implements java.sql.PreparedStatement.setBlob.

Sets the designated parameter to a InputStream object.

public final void
setBlob(int
index of the first parameter is 1, the second is 2, ...
parameterIndex
,
InputStream
an object that contains the data to set the parameter value to.
inputStream
)

Implements java.sql.PreparedStatement.setBlob.

Sets the designated parameter to a InputStream object.

public final void
setBoolean(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
boolean
the parameter value
x
)

Implements java.sql.PreparedStatement.setBoolean.

Set a parameter to a Java boolean value.

public final void
setByte(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
byte
the parameter value
x
)

Implements java.sql.PreparedStatement.setByte.

Set a parameter to a Java byte value.

public final void
setBytes(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
byte[]
the parameter value
x
)

Implements java.sql.PreparedStatement.setBytes.

Set a parameter to a Java array of bytes.

public final void
setCharacterStream(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
Reader
the java.io.Reader object that contains the Unicode data
reader
,
int
the number of characters in the stream
length
)

Implements java.sql.PreparedStatement.setCharacterStream.

Sets the designated parameter to the given Reader object, which is the given number of characters long.

public void
setCharacterStream(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
Reader
the java.io.Reader object that contains the Unicode data
reader
)

Implements java.sql.PreparedStatement.setCharacterStream.

Sets the designated parameter to the given Reader object.

public final void
setCharacterStream(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
Reader
the java Reader which contains the UNICODE value
x
,
long
the number of bytes in the stream
length
)

Implements java.sql.PreparedStatement.setCharacterStream.

Sets the designated parameter to the given Reader, which will have the specified number of bytes.

public final void
setClob(int
the first parameter is 1, the second is 2, ...
i
,
Clob
a Clob object that maps an SQL CLOB value
x
)

Implements java.sql.PreparedStatement.setClob.

Sets the designated parameter to the given java.sql.Clob object.

public final void
setClob(int
index of the first parameter is 1, the second is 2, ...
parameterIndex
,
Reader
An object that contains the data to set the parameter value to.
reader
,
long
the number of characters in the parameter data.
length
)

Implements java.sql.PreparedStatement.setClob.

Sets the designated parameter to a Reader object.

public final void
setClob(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
Reader
an object that contains the data to set the parameter value to.
reader
)

Implements java.sql.PreparedStatement.setClob.

Sets the designated parameter to a Reader object.

public final void
setDate(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
Date
the parameter value
x
)

Implements java.sql.PreparedStatement.setDate.

Set a parameter to a java.sql.Date value.

public final void
setDate(int
the first parameter is 1, the second is 2, ...
i
,
Date
the parameter value
x
,
Calendar
the Calendar object the driver will use to construct the date
cal
)

Implements java.sql.PreparedStatement.setDate.

Sets the designated parameter to the given java.sql.Date value, using the given Calendar object.

public final void
setDouble(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
double
the parameter value
x
)

Implements java.sql.PreparedStatement.setDouble.

Set a parameter to a Java double value.

public final void
setFloat(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
float
the parameter value
x
)

Implements java.sql.PreparedStatement.setFloat.

Set a parameter to a Java float value.

public final void
setInt(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
int
the parameter value
x
)

Implements java.sql.PreparedStatement.setInt.

Set a parameter to a Java int value.

public final void
setLong(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
long
the parameter value
x
)

Implements java.sql.PreparedStatement.setLong.

Set a parameter to a Java long value.

public final void
setNCharacterStream(int
of the first parameter is 1, the second is 2, ...
parameterIndex
,
Reader
the parameter value
value
)

Implements java.sql.PreparedStatement.setNCharacterStream.

Sets the designated parameter to a Reader object.

public final void
setNCharacterStream(int
of the first parameter is 1, the second is 2, ...
index
,
Reader
the parameter value
value
,
long
the number of characters in the parameter data.
length
)

Implements java.sql.PreparedStatement.setNCharacterStream.

Sets the designated parameter to a Reader object.

public final void
setNClob(int
of the first parameter is 1, the second is 2, ...
index
,
NClob
the parameter value
value
)

Implements java.sql.PreparedStatement.setNClob.

Sets the designated parameter to a java.sql.NClob object.

public final void
setNClob(int
index of the first parameter is 1, the second is 2, ...
parameterIndex
,
Reader
An object that contains the data to set the parameter value to.
reader
)

Implements java.sql.PreparedStatement.setNClob.

Sets the designated parameter to a Reader object.

public final void
setNClob(int
index of the first parameter is 1, the second is 2, ...
parameterIndex
,
Reader
An object that contains the data to set the parameter value to.
reader
,
long
the number of characters in the parameter data.
length
)

Implements java.sql.PreparedStatement.setNClob.

Sets the designated parameter to a Reader object.

public final void
setNString(int
of the first parameter is 1, the second is 2, ...
index
,
String
the parameter value
value
)

Implements java.sql.PreparedStatement.setNString.

Sets the designated parameter to the given String object.

public final void
setNull(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
int
SQL type code defined by java.sql.Types
sqlType
)

Implements java.sql.PreparedStatement.setNull.

Set a parameter to SQL NULL.

public final void
setNull(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
int
SQL type code defined by java.sql.Types
sqlType
,
String
the fully-qualified name of an SQL user-defined type; ignored if the parameter is not a user-defined type or REF
typeName
)

Implements java.sql.PreparedStatement.setNull.

Set a parameter to SQL NULL.

public final void
setObject(int
The first parameter is 1, the second is 2, ...
parameterIndex
,
Object
The object containing the input parameter value
x
,
int
The SQL type (as defined in java.sql.Types) to be sent to the database. The scale argument may further qualify this type.
targetSqlType
,
int
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,
scale
)

Implements java.sql.PreparedStatement.setObject.

The interface says that the type of the Object parameter must be compatible with the type of the targetSqlType.

public final void
setObject(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
Object
the object containing the input parameter value
x
,
int
the SQL type (as defined in java.sql.Types) to be sent to the database
targetSqlType
)

Implements java.sql.PreparedStatement.setObject.

This method is like setObject above, but assumes a scale of zero.

public final void
setObject(int
The first parameter is 1, the second is 2, ...
parameterIndex
,
Object
The object containing the input parameter value
x
)

Implements java.sql.PreparedStatement.setObject.

Set the value of a parameter using an object; use the java.lang equivalent objects for integral values.

public final void
setRef(int
the first parameter is 1, the second is 2, ...
i
,
Ref
an SQL REF value
x
)

Implements java.sql.PreparedStatement.setRef.

Sets the designated parameter to the given REF(<structured-type>) value.

public final void
setRowId(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
RowId
the parameter value
x
)

Implements java.sql.PreparedStatement.setRowId.

Sets the designated parameter to the given java.sql.RowId object.

public final void
setShort(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
short
the parameter value
x
)

Implements java.sql.PreparedStatement.setShort.

Set a parameter to a Java short value.

public final void
setSQLXML(int
index of the first parameter is 1, the second is 2, ...
parameterIndex
,
SQLXML
a SQLXML object that maps an SQL XML value
xmlObject
)

Implements java.sql.PreparedStatement.setSQLXML.

Sets the designated parameter to the given java.sql.SQLXML object.

public final void
setString(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
String
the parameter value
x
)

Implements java.sql.PreparedStatement.setString.

Set a parameter to a Java String value.

public final void
setTime(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
Time
the parameter value
x
)

Implements java.sql.PreparedStatement.setTime.

Set a parameter to a java.sql.Time value.

public final void
setTime(int
the first parameter is 1, the second is 2, ...
i
,
Time
the parameter value
x
,
Calendar
the Calendar object the driver will use to construct the time
cal
)

Implements java.sql.PreparedStatement.setTime.

Sets the designated parameter to the given java.sql.Time value, using the given Calendar object.

public final void
setTimestamp(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
Timestamp
the parameter value
x
)

Implements java.sql.PreparedStatement.setTimestamp.

Set a parameter to a java.sql.Timestamp value.

public final void
setTimestamp(int
the first parameter is 1, the second is 2, ...
i
,
Timestamp
the parameter value
x
,
Calendar
the Calendar object the driver will use to construct the timestamp
cal
)

Implements java.sql.PreparedStatement.setTimestamp.

Sets the designated parameter to the given java.sql.Timestamp value, using the given Calendar object.

public final void
setUnicodeStream(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
InputStream
the java input stream which contains the UNICODE parameter value
x
,
int
the number of bytes in the stream
length
)

Implements java.sql.PreparedStatement.setUnicodeStream.

Deprecated

We do this inefficiently and read it all in here.

public final void
setURL(int
the first parameter is 1, the second is 2, ...
i
,
URL
the java.net.URL object to be set
x
)

Implements java.sql.PreparedStatement.setURL.

Sets the designated parameter to the given java.net.URL value.

Inherited from org.apache.derby.iapi.jdbc.BrokeredStatement:
addBatchcancelcheckIfClosedclearBatchclearWarningscloseOnCompletioncontrolCheckcreateDuplicateStatementexecuteexecuteexecuteexecuteexecuteBatchexecuteLargeBatchexecuteLargeUpdateexecuteLargeUpdateexecuteLargeUpdateexecuteLargeUpdateexecuteQueryexecuteUpdateexecuteUpdateexecuteUpdateexecuteUpdategetConnectiongetFetchDirectiongetFetchSizegetGeneratedKeysgetLargeMaxRowsgetLargeUpdateCountgetMaxFieldSizegetMaxRowsgetMoreResultsgetMoreResultsgetQueryTimeoutgetResultSetgetResultSetConcurrencygetResultSetHoldabilitygetResultSetTypegetUpdateCountgetWarningsisClosedisCloseOnCompletionisPoolableisWrapperForsetCursorNamesetEscapeProcessingsetFetchDirectionsetFetchSizesetLargeMaxRowssetMaxFieldSizesetMaxRowssetPoolablesetQueryTimeoutsetStatementStateunableToUnwrapunwrapwrapResultSet