|
|||||||||
| Home >> All >> org >> apache >> derby >> iapi >> [ jdbc overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.apache.derby.iapi.jdbc
Class BrokeredPreparedStatement

java.lang.Objectorg.apache.derby.iapi.jdbc.BrokeredStatement
org.apache.derby.iapi.jdbc.BrokeredPreparedStatement
- All Implemented Interfaces:
- java.sql.PreparedStatement, java.sql.Statement
- Direct Known Subclasses:
- BrokeredCallableStatement, BrokeredPreparedStatement30
- public class BrokeredPreparedStatement
- extends BrokeredStatement
- implements java.sql.PreparedStatement
- extends BrokeredStatement
JDBC 2 brokered PreparedStatement. Forwards calls off to a real prepared statement obtained through the BrokeredStatementControl getRealPreparedStatement method.
| Field Summary | |
protected java.lang.String |
sql
SQL used to create me. |
| Fields inherited from class org.apache.derby.iapi.jdbc.BrokeredStatement |
control, jdbcLevel, resultSetConcurrency, resultSetHoldability, resultSetType |
| 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 | |
BrokeredPreparedStatement(BrokeredStatementControl control,
int jdbcLevel,
java.lang.String sql)
|
|
| Method Summary | |
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. |
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()
This method executes a prepared SQL query. |
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.PreparedStatement |
getPreparedStatement()
|
java.sql.Statement |
getStatement()
Override the BrokeredStatement's getStatement() to always return a PreparedStatement. |
void |
setArray(int i,
java.sql.Array x)
This method sets the specified parameter from the given Java Array value. |
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,
int length)
This method sets the specified parameter from the given Java binary InputStream value. |
void |
setBlob(int i,
java.sql.Blob x)
This method sets the specified parameter from the given Java Blob value. |
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,
int length)
This method sets the specified parameter from the given Java character Reader value. |
void |
setClob(int i,
java.sql.Clob x)
This method sets the specified parameter from the given Java Clob value. |
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)
This method sets the specified parameter from the given Java java.sql.Date value. |
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)
This method sets the specified parameter from the given Java Ref value. |
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)
This method sets the specified parameter from the given Java java.sql.Time value. |
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)
This method sets the specified parameter from the given Java java.sql.Timestamp value. |
void |
setUnicodeStream(int parameterIndex,
java.io.InputStream x,
int length)
We do this inefficiently and read it all in here. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.sql.PreparedStatement |
getParameterMetaData, setURL |
| Field Detail |
sql
protected final java.lang.String sql
- SQL used to create me.
| Constructor Detail |
BrokeredPreparedStatement
public BrokeredPreparedStatement(BrokeredStatementControl control, int jdbcLevel, java.lang.String sql) throws java.sql.SQLException
| Method Detail |
executeQuery
public final java.sql.ResultSet executeQuery() throws java.sql.SQLException
- A prepared SQL query is executed and its ResultSet is returned.
- Specified by:
executeQueryin interfacejava.sql.PreparedStatement
executeUpdate
public final int executeUpdate()
throws java.sql.SQLException
- Execute a SQL INSERT, UPDATE or DELETE statement. In addition,
SQL statements that return nothing such as SQL DDL statements
can be executed.
- Specified by:
executeUpdatein interfacejava.sql.PreparedStatement
setNull
public final void setNull(int parameterIndex,
int sqlType)
throws java.sql.SQLException
- Set a parameter to SQL NULL.
Note: You must specify the parameter's SQL type.
- Specified by:
setNullin interfacejava.sql.PreparedStatement
setNull
public final void setNull(int parameterIndex,
int sqlType,
java.lang.String typeName)
throws java.sql.SQLException
- Set a parameter to SQL NULL.
Note: You must specify the parameter's SQL type.
- Specified by:
setNullin interfacejava.sql.PreparedStatement
setBoolean
public final void setBoolean(int parameterIndex,
boolean x)
throws java.sql.SQLException
- Set a parameter to a Java boolean value. According to the JDBC API spec,
the driver converts this to a SQL BIT value when it sends it to the
database. But we don't have to do this, since the database engine
supports a boolean type.
- Specified by:
setBooleanin interfacejava.sql.PreparedStatement
setByte
public final void setByte(int parameterIndex,
byte x)
throws java.sql.SQLException
- Set a parameter to a Java byte value. The driver converts this
to a SQL TINYINT value when it sends it to the database.
- Specified by:
setBytein interfacejava.sql.PreparedStatement
setShort
public final void setShort(int parameterIndex,
short x)
throws java.sql.SQLException
- Set a parameter to a Java short value. The driver converts this
to a SQL SMALLINT value when it sends it to the database.
- Specified by:
setShortin interfacejava.sql.PreparedStatement
setInt
public final void setInt(int parameterIndex,
int x)
throws java.sql.SQLException
- Set a parameter to a Java int value. The driver converts this
to a SQL INTEGER value when it sends it to the database.
- Specified by:
setIntin interfacejava.sql.PreparedStatement
setLong
public final void setLong(int parameterIndex,
long x)
throws java.sql.SQLException
- Set a parameter to a Java long value. The driver converts this
to a SQL BIGINT value when it sends it to the database.
- Specified by:
setLongin interfacejava.sql.PreparedStatement
setFloat
public final void setFloat(int parameterIndex,
float x)
throws java.sql.SQLException
- Set a parameter to a Java float value. The driver converts this
to a SQL FLOAT value when it sends it to the database.
- Specified by:
setFloatin interfacejava.sql.PreparedStatement
setDouble
public final void setDouble(int parameterIndex,
double x)
throws java.sql.SQLException
- Set a parameter to a Java double value. The driver converts this
to a SQL DOUBLE value when it sends it to the database.
- Specified by:
setDoublein interfacejava.sql.PreparedStatement
setBigDecimal
public final void setBigDecimal(int parameterIndex,
java.math.BigDecimal x)
throws java.sql.SQLException
- Set a parameter to a java.math.BigDecimal value.
The driver converts this to a SQL NUMERIC value when
it sends it to the database.
- Specified by:
setBigDecimalin interfacejava.sql.PreparedStatement
setString
public final void setString(int parameterIndex,
java.lang.String x)
throws java.sql.SQLException
- Set a parameter to a Java String value. The driver converts this
to a SQL VARCHAR or LONGVARCHAR value (depending on the arguments
size relative to the driver's limits on VARCHARs) when it sends
it to the database.
- Specified by:
setStringin interfacejava.sql.PreparedStatement
setBytes
public final void setBytes(int parameterIndex,
byte[] x)
throws java.sql.SQLException
- Set a parameter to a Java array of bytes. The driver converts
this to a SQL VARBINARY or LONGVARBINARY (depending on the
argument's size relative to the driver's limits on VARBINARYs)
when it sends it to the database.
- Specified by:
setBytesin interfacejava.sql.PreparedStatement
setDate
public final void setDate(int parameterIndex,
java.sql.Date x)
throws java.sql.SQLException
- Set a parameter to a java.sql.Date value. The driver converts this
to a SQL DATE value when it sends it to the database.
- Specified by:
setDatein interfacejava.sql.PreparedStatement
setTime
public final void setTime(int parameterIndex,
java.sql.Time x)
throws java.sql.SQLException
- Set a parameter to a java.sql.Time value. The driver converts this
to a SQL TIME value when it sends it to the database.
- Specified by:
setTimein interfacejava.sql.PreparedStatement
setTimestamp
public final void setTimestamp(int parameterIndex,
java.sql.Timestamp x)
throws java.sql.SQLException
- Set a parameter to a java.sql.Timestamp value. The driver
converts this to a SQL TIMESTAMP value when it sends it to the
database.
- Specified by:
setTimestampin interfacejava.sql.PreparedStatement
setAsciiStream
public final void setAsciiStream(int parameterIndex,
java.io.InputStream x,
int length)
throws java.sql.SQLException
- We do this inefficiently and read it all in here. The target type
is assumed to be a String.
- Specified by:
setAsciiStreamin interfacejava.sql.PreparedStatement
setUnicodeStream
public final void setUnicodeStream(int parameterIndex,
java.io.InputStream x,
int length)
throws java.sql.SQLException
- We do this inefficiently and read it all in here. The target type
is assumed to be a String. The unicode source is assumed to be
in char[]. RESOLVE: might it be in UTF, instead? that'd be faster!
- Specified by:
setUnicodeStreamin interfacejava.sql.PreparedStatement
setBinaryStream
public final void setBinaryStream(int parameterIndex,
java.io.InputStream x,
int length)
throws java.sql.SQLException
- Description copied from interface:
java.sql.PreparedStatement - This method sets the specified parameter from the given Java
binary
InputStreamvalue.- Specified by:
setBinaryStreamin interfacejava.sql.PreparedStatement
addBatch
public final void addBatch()
throws java.sql.SQLException
- JDBC 2.0
Add a set of parameters to the batch.
- Specified by:
addBatchin interfacejava.sql.PreparedStatement
clearParameters
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.
- Specified by:
clearParametersin interfacejava.sql.PreparedStatement
getMetaData
public final java.sql.ResultSetMetaData getMetaData() throws java.sql.SQLException
- JDBC 2.0
The number, types and properties of a ResultSet's columns
are provided by the getMetaData method.
- Specified by:
getMetaDatain interfacejava.sql.PreparedStatement
setObject
public final void setObject(int parameterIndex,
java.lang.Object x,
int targetSqlType,
int scale)
throws java.sql.SQLException
- The interface says that the type of the Object parameter must
be compatible with the type of the targetSqlType. We check that,
and if it flies, we expect the underlying engine to do the
required conversion once we pass in the value using its type.
So, an Integer converting to a CHAR is done via setInteger()
support on the underlying CHAR type.
If x is null, it won't tell us its type, so we pass it on to setNull
- Specified by:
setObjectin interfacejava.sql.PreparedStatement
setObject
public final void setObject(int parameterIndex,
java.lang.Object x,
int targetSqlType)
throws java.sql.SQLException
- This method is like setObject above, but assumes a scale of zero.
- Specified by:
setObjectin interfacejava.sql.PreparedStatement
setObject
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.
- Specified by:
setObjectin interfacejava.sql.PreparedStatement
execute
public final boolean execute()
throws java.sql.SQLException
- Description copied from interface:
java.sql.PreparedStatement - This method executes a prepared SQL query.
Some prepared statements return multiple results; the execute method
handles these complex statements as well as the simpler form of
statements handled by executeQuery and executeUpdate.
- Specified by:
executein interfacejava.sql.PreparedStatement
setCharacterStream
public final void setCharacterStream(int parameterIndex,
java.io.Reader reader,
int length)
throws java.sql.SQLException
- Description copied from interface:
java.sql.PreparedStatement - This method sets the specified parameter from the given Java
character
Readervalue.- Specified by:
setCharacterStreamin interfacejava.sql.PreparedStatement
setRef
public final void setRef(int i,
java.sql.Ref x)
throws java.sql.SQLException
- Description copied from interface:
java.sql.PreparedStatement - This method sets the specified parameter from the given Java
Refvalue. The default object type to SQL type mapping will be used.- Specified by:
setRefin interfacejava.sql.PreparedStatement
setBlob
public final void setBlob(int i,
java.sql.Blob x)
throws java.sql.SQLException
- Description copied from interface:
java.sql.PreparedStatement - This method sets the specified parameter from the given Java
Blobvalue. The default object type to SQL type mapping will be used.- Specified by:
setBlobin interfacejava.sql.PreparedStatement
setClob
public final void setClob(int i,
java.sql.Clob x)
throws java.sql.SQLException
- Description copied from interface:
java.sql.PreparedStatement - This method sets the specified parameter from the given Java
Clobvalue. The default object type to SQL type mapping will be used.- Specified by:
setClobin interfacejava.sql.PreparedStatement
setArray
public final void setArray(int i,
java.sql.Array x)
throws java.sql.SQLException
- Description copied from interface:
java.sql.PreparedStatement - This method sets the specified parameter from the given Java
Arrayvalue. The default object type to SQL type mapping will be used.- Specified by:
setArrayin interfacejava.sql.PreparedStatement
setDate
public final void setDate(int i,
java.sql.Date x,
java.util.Calendar cal)
throws java.sql.SQLException
- Description copied from interface:
java.sql.PreparedStatement - This method sets the specified parameter from the given Java
java.sql.Datevalue.- Specified by:
setDatein interfacejava.sql.PreparedStatement
setTime
public final void setTime(int i,
java.sql.Time x,
java.util.Calendar cal)
throws java.sql.SQLException
- Description copied from interface:
java.sql.PreparedStatement - This method sets the specified parameter from the given Java
java.sql.Timevalue.- Specified by:
setTimein interfacejava.sql.PreparedStatement
setTimestamp
public final void setTimestamp(int i,
java.sql.Timestamp x,
java.util.Calendar cal)
throws java.sql.SQLException
- Description copied from interface:
java.sql.PreparedStatement - This method sets the specified parameter from the given Java
java.sql.Timestampvalue.- Specified by:
setTimestampin interfacejava.sql.PreparedStatement
getPreparedStatement
public java.sql.PreparedStatement getPreparedStatement() throws java.sql.SQLException
getStatement
public final java.sql.Statement getStatement() throws java.sql.SQLException
- Override the BrokeredStatement's getStatement() to always return a PreparedStatement.
- Overrides:
getStatementin classBrokeredStatement
createDuplicateStatement
public java.sql.PreparedStatement createDuplicateStatement(java.sql.Connection conn, java.sql.PreparedStatement oldStatement) throws java.sql.SQLException
- Create a duplicate PreparedStatement to this, including state, from the passed in Connection.
|
|||||||||
| Home >> All >> org >> apache >> derby >> iapi >> [ jdbc overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC