All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class oracle.jdbc.driver.OraclePreparedStatement

java.lang.Object
   |
   +----oracle.jdbc.driver.OracleStatement
           |
           +----oracle.jdbc.driver.OraclePreparedStatement

public class OraclePreparedStatement
extends OracleStatement
implements PreparedStatement
Oracle prepared statement class.


Method Index

 o addBatch()
Add a set of parameters to the batch.
 o addBatch(String)
This method cannot be used in OraclePreparedStatement.
 o clearBatch()
Make the set of parameters in the current batch empty.
 o clearParameters()

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

 o close()
Close the prepared statement.
 o defineParameterType(int, int, int)
Define the type under which you will bind the parameter and the maximum size of data you will bind in binds.
 o execute()
Execute the statement.
 o executeBatch()
Submit a batch of parameters to the database for execution.
 o executeQuery()
Execute the query statement.
 o executeUpdate()
Execute the update statement.
 o getExecuteBatch()
Retrieve the batch value (for Oracle-style batching only).
 o getMetaData()
JDBC 2.0 Gets the number, types and properties of a ResultSet's columns.
 o sendBatch()
Send any existing Oracle-style batch.
 o setArray(int, Array)
JDBC 2.0.
 o setARRAY(int, ARRAY)
Oracle specific.
 o setAsciiStream(int, InputStream, int)
Sets the designated parameter to the given input stream, which will have the specified number of bytes.
 o setBFILE(int, BFILE)
Oracle specific.
 o setBfile(int, BFILE)
Oracle specific.
 o setBigDecimal(int, BigDecimal)
Sets the designated parameter to a java.lang.BigDecimal value.
 o setBinaryStream(int, InputStream, int)
Sets the designated parameter to the given input stream, which will have the specified number of bytes.
 o setBLOB(int, BLOB)
Oracle specific.
 o setBlob(int, Blob)
JDBC 2.0.
 o setBoolean(int, boolean)
Sets the designated parameter to a Java boolean value.
 o setByte(int, byte)
Sets the designated parameter to a Java byte value.
 o setBytes(int, byte[])
Sets the designated parameter to a Java array of bytes.
 o setCHAR(int, CHAR)
Oracle specific.
 o setCharacterStream(int, Reader, int)
JDBC 2.0 Sets the designated parameter to the given Reader object, which is the given number of characters long.
 o setClob(int, Clob)
JDBC 2.0.
 o setCLOB(int, CLOB)
Oracle specific.
 o setCursor(int, ResultSet)
Oracle specific.
 o setCustomDatum(int, CustomDatum)
Oracle specific.
 o setDATE(int, DATE)
Oracle specific.
 o setDate(int, Date)
Sets the designated parameter to a java.sql.Date value.
 o setDate(int, Date, Calendar)
JDBC 2.0 Sets the designated parameter to a java.sql.Date value, using the given Calendar object.
 o setDouble(int, double)
Sets the designated parameter to a Java double value.
 o setExecuteBatch(int)
Set the batch value (for Oracle-style batching only).
 o setFixedCHAR(int, String)
Use this method when binding to a CHAR column in the where clause of a Select statement.
 o setFloat(int, float)
Sets the designated parameter to a Java float value.
 o setInt(int, int)
Sets the designated parameter to a Java int value.
 o setLong(int, long)
Sets the designated parameter to a Java long value.
 o setNull(int, int)
Sets the designated parameter to SQL NULL.
 o setNull(int, int, String)
Implements JDBC 2.0 setNull for object types.
 o setNUMBER(int, NUMBER)
Oracle specific.
 o setObject(int, Object)
Sets the value of the designated parameter with the given object.
 o setObject(int, Object, int)
Sets the value of the designated parameter with the given object.
 o setObject(int, Object, int, int)

Sets the value of a parameter using an object.

 o setOracleObject(int, Datum)
Oracle specific.
 o setRAW(int, RAW)
Oracle specific.
 o setRef(int, Ref)
JDBC 2.0 Sets a Ref(<structured-type>) parameter.
 o setREF(int, REF)
Oracle specific.
 o setRefType(int, REF)
Oracle specific.
 o setROWID(int, ROWID)
Oracle specific.
 o setShort(int, short)
Sets the designated parameter to a Java short value.
 o setString(int, String)
Sets the designated parameter to a Java String value.
 o setSTRUCT(int, STRUCT)
Oracle specific.
 o setTime(int, Time)
Sets the designated parameter to a java.sql.Time value.
 o setTime(int, Time, Calendar)
JDBC 2.0 Sets the designated parameter to a java.sql.Time value, using the given Calendar object.
 o setTimestamp(int, Timestamp)
Sets the designated parameter to a java.sql.Timestamp value.
 o setTimestamp(int, Timestamp, Calendar)
JDBC 2.0 Sets the designated parameter to a java.sql.Timestamp value, using the given Calendar object.
 o setUnicodeStream(int, InputStream, int)
Sets the designated parameter to the given input stream, which will have the specified number of bytes. Deprecated.

Methods

 o close
 public synchronized void close() throws SQLException
Close the prepared statement.

Throws: SQLException
if error(s) occurred.
Overrides:
close in class OracleStatement
 o executeQuery
 public synchronized ResultSet executeQuery() throws SQLException
Execute the query statement.

Returns:
the query result set.
Throws: SQLException
if error(s) occurred.
 o executeUpdate
 public synchronized int executeUpdate() throws SQLException
Execute the update statement.

Throws: SQLException
if error(s) occurred.
 o execute
 public synchronized boolean execute() throws SQLException
Execute the statement.

Throws: SQLException
if error(s) occurred.
 o sendBatch
 public synchronized int sendBatch() throws SQLException
Send any existing Oracle-style batch.

This API is used in the context of Oracle-style batching. It flushes any batched executions before the batch value is reached. Executions normally happen when the number of executions reaches the batch value, which is set via the API setExecuteBatch(). It does not do anything if the statement does not use Oracle-style batching.

To use this API, the user must cast the PreparedStatement object to oracle.jdbc.driver.OraclePreparedStatement.

Returns:
the update count.
Throws: SQLException
if an error occurred.
Overrides:
sendBatch in class OracleStatement
 o setExecuteBatch
 public synchronized void setExecuteBatch(int batchValue) throws SQLException
Set the batch value (for Oracle-style batching only).

The Oracle Jdbc driver can "batch" multiple executions of a single statement with different bind variables. Actual execution happens when the number of batched executions reaches the "batch value", which is set by this API.

The batch value for this prepared statement can be set at any time via this API. Changing the batch value will affect all future executes.

The batch value will automatically be set to 1 by the driver if any of the bind types is of type stream. This overrides any value that the user might have set. Binds that were performed before any setXXXStream() is called, and that have not been executed, will be flushed (i.e. executed).

To use this API, the user must cast the PreparedStatement object to oracle.jdbc.driver.OraclePreparedStatement.

Parameters:
batchValue batch - value to be set. It must be greater than or equal to 1.
 o getExecuteBatch
 public final int getExecuteBatch()
Retrieve the batch value (for Oracle-style batching only).

Returns:
the batch value last set by setExecuteBatch().
 o defineParameterType
 public synchronized void defineParameterType(int param_index,
                                              int type,
                                              int max_size) throws SQLException
Define the type under which you will bind the parameter and the maximum size of data you will bind in binds.

Similarly to defineColumnType. Before executing a Query you may choose to inform JDBC of the type and maximum length of the bind parameter. If not, based on the setXXX call, the maximum length of the type is taken, i.e., for a setString a 4k buffer is allocated. This API does not reduce the network round trip. It is purely a memory optimization API.

Note: You should use Types.CHAR as the type value if you are going bind later as setCHAR and use Types.VARCHAR if you are going to bind as setString for effective results.

Parameters:
param_index - Index of bind parameter.
type - Type to be assigned to bind parameter. This type could be different from the native type of the column. Appropriate conversions will be done.
max_size - Maximum length of bind data in bytes.
 o getMetaData
 public ResultSetMetaData getMetaData() throws SQLException
JDBC 2.0 Gets the number, types and properties of a ResultSet's columns.

Returns:
the description of a ResultSet's columns
Throws: SQLException
if a database access error occurs
 o setNull
 public synchronized void setNull(int paramIndex,
                                  int sqlType,
                                  String sqlName) throws SQLException
Implements JDBC 2.0 setNull for object types. Sets the designated parameter to SQL NULL. This version of setNull should be used for STRUCT, ARRAY and REF type parameters.

Note: To be portable, applications must give the SQL type code and the fully-qualified SQL type name when specifying a NULL user-defined or REF parameter. In the case of a user-named type the name is the type name of the parameter itself. For a REF parameter the name is the type name of the referenced type. Although it is intended for user-named and Ref parameters, this method may be used to set a null parameter of any JDBC type. If the parameter does not have a user-named or REF type, the given typeName is ignored.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
sqlType - a value from java.sql.Types
typeName - the fully-qualified name of an SQL user-named type, ignored if the parameter is not a user-named type or REF
Throws: SQLException
if a database access error occurs
 o setNull
 public synchronized void setNull(int paramIndex,
                                  int sqlType) throws SQLException
Sets the designated parameter to SQL NULL. This method can't be used for STRUCT, REF and ARRAY type parameters.

Note: You must specify the parameter's SQL type.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
sqlType - the SQL type code defined in java.sql.Types
Throws: SQLException
if a database access error occurs
 o setBoolean
 public synchronized void setBoolean(int paramIndex,
                                     boolean x) throws SQLException
Sets the designated parameter to a Java boolean value.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws: SQLException
if a database access error occurs
 o setByte
 public synchronized void setByte(int paramIndex,
                                  byte x) throws SQLException
Sets the designated parameter to a Java byte value.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws: SQLException
if a database access error occurs
 o setShort
 public synchronized void setShort(int paramIndex,
                                   short x) throws SQLException
Sets the designated parameter to a Java short value.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws: SQLException
if a database access error occurs
 o setInt
 public synchronized void setInt(int paramIndex,
                                 int x) throws SQLException
Sets the designated parameter to a Java int value.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws: SQLException
if a database access error occurs
 o setLong
 public synchronized void setLong(int paramIndex,
                                  long x) throws SQLException
Sets the designated parameter to a Java long value.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws: SQLException
if a database access error occurs
 o setFloat
 public synchronized void setFloat(int paramIndex,
                                   float x) throws SQLException
Sets the designated parameter to a Java float value.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws: SQLException
if a database access error occurs
 o setDouble
 public synchronized void setDouble(int paramIndex,
                                    double x) throws SQLException
Sets the designated parameter to a Java double value.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws: SQLException
if a database access error occurs
 o setBigDecimal
 public synchronized void setBigDecimal(int paramIndex,
                                        BigDecimal x) throws SQLException
Sets the designated parameter to a java.lang.BigDecimal value.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws: SQLException
if a database access error occurs
 o setString
 public synchronized void setString(int paramIndex,
                                    String x) throws SQLException
Sets the designated parameter to a Java String value.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws: SQLException
if a database access error occurs
 o setFixedCHAR
 public synchronized void setFixedCHAR(int paramIndex,
                                       String x) throws SQLException
Use this method when binding to a CHAR column in the where clause of a Select statement. A non padded comparision will be done unlike in setCHAR and setString case. Not particularly needed for an insert as the database will pad it.

Parameters:
paramIndex - index of the bind variable
x - the literal/variable to be bound.
 o setCursor
 public synchronized void setCursor(int paramIndex,
                                    ResultSet rs) throws SQLException
Oracle specific. Sets the designated parameter to a java.sql.ResultSet. This is used for RefCursor parameter only.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws: SQLException
if a database access error occurs
 o setROWID
 public synchronized void setROWID(int paramIndex,
                                   ROWID rowid) throws SQLException
Oracle specific. Sets the designated parameter to a oracle.sql.RAW.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws: SQLException
if a database access error occurs
 o setArray
 public synchronized void setArray(int paramIndex,
                                   Array arr) throws SQLException
JDBC 2.0. Sets the designated parameter to a Array value.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws: SQLException
if a database access error occurs
 o setARRAY
 public synchronized void setARRAY(int paramIndex,
                                   ARRAY arr) throws SQLException
Oracle specific. Sets the designated parameter to a oracle.sql.ARRAY.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws: SQLException
if a database access error occurs
 o setSTRUCT
 public synchronized void setSTRUCT(int paramIndex,
                                    STRUCT struct) throws SQLException
Oracle specific. Sets the designated parameter to a oracle.sql.STRUCT.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws: SQLException
if a database access error occurs
 o setRAW
 public synchronized void setRAW(int paramIndex,
                                 RAW raw) throws SQLException
Oracle specific. Sets the designated parameter to a oracle.sql.RAW.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws: SQLException
if a database access error occurs
 o setCHAR
 public synchronized void setCHAR(int paramIndex,
                                  CHAR ch) throws SQLException
Oracle specific. Sets the designated parameter to a oracle.sql.CHAR.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws: SQLException
if a database access error occurs
 o setDATE
 public synchronized void setDATE(int paramIndex,
                                  DATE date) throws SQLException
Oracle specific. Sets the designated parameter to a oracle.sql.DATE.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws: SQLException
if a database access error occurs
 o setNUMBER
 public synchronized void setNUMBER(int paramIndex,
                                    NUMBER num) throws SQLException
Oracle specific. Sets the designated parameter to a oracle.sql.NUMBER.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws: SQLException
if a database access error occurs
 o setBLOB
 public synchronized void setBLOB(int paramIndex,
                                  BLOB lob) throws SQLException
Oracle specific. Sets the designated parameter to a oracle.sql.BLOB.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws: SQLException
if a database access error occurs
 o setBlob
 public synchronized void setBlob(int paramIndex,
                                  Blob lob) throws SQLException
JDBC 2.0. Sets the designated parameter to a Blob value.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws: SQLException
if a database access error occurs
 o setCLOB
 public synchronized void setCLOB(int paramIndex,
                                  CLOB lob) throws SQLException
Oracle specific. Sets the designated parameter to a oracle.sql.CLOB.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws: SQLException
if a database access error occurs
 o setClob
 public synchronized void setClob(int paramIndex,
                                  Clob lob) throws SQLException
JDBC 2.0. Sets the designated parameter to a Clob value.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws: SQLException
if a database access error occurs
 o setBFILE
 public synchronized void setBFILE(int paramIndex,
                                   BFILE file) throws SQLException
Oracle specific. Sets the designated parameter to a oracle.sql.BFILE value.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws: SQLException
if a database access error occurs
 o setBfile
 public synchronized void setBfile(int paramIndex,
                                   BFILE file) throws SQLException
Oracle specific. Sets the designated parameter to a oracle.sql.BFILE value.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws: SQLException
if a database access error occurs
 o setBytes
 public synchronized void setBytes(int paramIndex,
                                   byte x[]) throws SQLException
Sets the designated parameter to a Java array of bytes.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws: SQLException
if a database access error occurs
 o setDate
 public synchronized void setDate(int paramIndex,
                                  Date x) throws SQLException
Sets the designated parameter to a java.sql.Date value.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws: SQLException
if a database access error occurs
 o setTime
 public synchronized void setTime(int paramIndex,
                                  Time x) throws SQLException
Sets the designated parameter to a java.sql.Time value.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws: SQLException
if a database access error occurs
 o setTimestamp
 public synchronized void setTimestamp(int paramIndex,
                                       Timestamp x) throws SQLException
Sets the designated parameter to a java.sql.Timestamp value.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws: SQLException
if a database access error occurs
 o setAsciiStream
 public synchronized void setAsciiStream(int paramIndex,
                                         InputStream istream,
                                         int length) throws SQLException
Sets the designated parameter to the given input stream, which will have the specified number of bytes. When a very large ASCII value is input to a LONG parameter, it may be more practical to send it via a java.io.InputStream. JDBC will read the data from the stream as needed, until it reaches end-of-file. The JDBC driver will do any necessary conversion from ASCII to the database char format.

Note: There are restrictions to use this method for CLOBs. Please see details in Oracle JDBC documents or Readme to avoid data lossage.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
istream - the Java input stream that contains the ASCII parameter value
length - the number of bytes in the stream
Throws: SQLException
if a database access error occurs
 o setBinaryStream
 public synchronized void setBinaryStream(int paramIndex,
                                          InputStream istream,
                                          int length) throws SQLException
Sets the designated parameter to the given input stream, which will have the specified number of bytes. When a very large binary value is input to a LONG RAW parameter, it may be more practical to send it via a java.io.InputStream. JDBC will read the data from the stream as needed, until it reaches end-of-file.

Note: There are restrictions to use this method for BLOBs. Please see details in Oracle JDBC documents or Readme to avoid data lossage.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the java input stream which contains the binary parameter value
length - the number of bytes in the stream
Throws: SQLException
if a database access error occurs
 o setUnicodeStream
 public synchronized void setUnicodeStream(int paramIndex,
                                           InputStream istream,
                                           int length) throws SQLException
Note: setUnicodeStream() is deprecated.

Sets the designated parameter to the given input stream, which will have the specified number of bytes. When a very large UNICODE value is input to a LONG parameter, it may be more practical to send it via a java.io.InputStream. JDBC will read the data from the stream as needed, until it reaches end-of-file. The JDBC driver will do any necessary conversion from UNICODE to the database char format. The byte format of the Unicode stream is the 2 bytes UCS-2 encoding.

Note: There are restrictions to use this method for CLOBs. Please see details in Oracle JDBC documents or Readme to avoid data lossage.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the java input stream which contains the UNICODE parameter value
length - the number of bytes in the stream
Throws: SQLException
if a database access error occurs
 o setCustomDatum
 public synchronized void setCustomDatum(int paramIndex,
                                         CustomDatum x) throws SQLException
Oracle specific. Sets the designated parameter to a oracle.sql.CustomDatum value.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws: SQLException
if a database access error occurs
 o setObject
 public synchronized void setObject(int paramIndex,
                                    Object x,
                                    int targetSqlType,
                                    int scale) throws SQLException

Sets the value of a parameter using an object. The second argument must be an object type.

The given Java object will be converted to the targetSqlType before being sent to the database. If the object has a custom mapping (is of a class implementing SQLData), the JDBC driver should call its method writeSQL to write it to the SQL data stream.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the object containing the input parameter value
targetSqlType - the SQL type (as defined in java.sql.Types or OracleTypes) to be sent to the database.
scale - for numeric types. Ignored for other types.
Throws: SQLException
if a database access error occurs
See Also:
Types
 o setObject
 public void setObject(int paramIndex,
                       Object x,
                       int targetSqlType) throws SQLException
Sets the value of the designated parameter with the given object. This method is like setObject above, except that it assumes a scale of zero.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the object containing the input parameter value
targetSqlType - the SQL type (as defined in java.sql.Types) to be sent to the database
Throws: SQLException
if a database access error occurs
 o setRefType
 public void setRefType(int paramIndex,
                        REF ref) throws SQLException
Oracle specific. Sets the designated parameter to a oracle.sql.REF value.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws: SQLException
if a database access error occurs
 o setRef
 public synchronized void setRef(int paramIndex,
                                 Ref ref) throws SQLException
JDBC 2.0 Sets a Ref(<structured-type>) parameter.

Parameters:
i - the first parameter is 1, the second is 2, ...
x - an object representing data of an SQL REF Type
Throws: SQLException
if a database access error occurs
 o setREF
 public synchronized void setREF(int paramIndex,
                                 REF ref) throws SQLException
Oracle specific. Sets the designated parameter to a oracle.sql.REF value.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws: SQLException
if a database access error occurs
 o setObject
 public synchronized void setObject(int paramIndex,
                                    Object x) throws SQLException
Sets the value of the designated parameter with the given object. This method is like setObject above, except that it finds out the SQL type base on the given object's type.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the object containing the input parameter value
targetSqlType - the SQL type (as defined in java.sql.Types) to be sent to the database
Throws: SQLException
if a database access error occurs
 o setOracleObject
 public synchronized void setOracleObject(int paramIndex,
                                          Datum x) throws SQLException
Oracle specific. Sets the designated parameter to a oracle.sql.Datum value.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
Throws: SQLException
if a database access error occurs
 o clearParameters
 public synchronized void clearParameters() throws 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.

 o setCharacterStream
 public void setCharacterStream(int paramIndex,
                                Reader reader,
                                int length) throws SQLException
JDBC 2.0 Sets the designated parameter to the given Reader object, which is the given number of characters long. When a very large UNICODE value is input to a LONG parameter, it may be more practical to send it via a java.io.Reader. JDBC will read the data from the stream as needed, until it reaches end-of-file. The JDBC driver will do any necessary conversion from UNICODE to the database char format.

Note: There are restrictions to use this method to access CLOBs in database. To avoid data lossage, please read Oracle JDBC documents or Reademe for details.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the java reader which contains the UNICODE data
length - the number of characters in the stream
Throws: SQLException
if a database access error occurs
 o setDate
 public void setDate(int paramIndex,
                     Date x,
                     Calendar cal) throws SQLException
JDBC 2.0 Sets the designated parameter to a java.sql.Date value, using the given Calendar object. Since Oracle database doesn't support timezone for DATE. This method set the same value as setDate(idx, x).

 o setTime
 public void setTime(int paramIndex,
                     Time x,
                     Calendar cal) throws SQLException
JDBC 2.0 Sets the designated parameter to a java.sql.Time value, using the given Calendar object. Since Oracle database doesn't support timezone for DATE. This method set the same value as setTime(idx, x).

 o setTimestamp
 public void setTimestamp(int paramIndex,
                          Timestamp x,
                          Calendar cal) throws SQLException
JDBC 2.0 Sets the designated parameter to a java.sql.Timestamp value, using the given Calendar object. Since Oracle database doesn't support timezone for DATE. This method set the same value as setTimestamp(idx, x).

 o addBatch
 public synchronized void addBatch() throws SQLException
Add a set of parameters to the batch.

Throws: SQLException
if an error occurred.
 o addBatch
 public synchronized void addBatch(String sql) throws SQLException
This method cannot be used in OraclePreparedStatement.

Overrides:
addBatch in class OracleStatement
 o clearBatch
 public synchronized void clearBatch() throws SQLException
Make the set of parameters in the current batch empty.

Throws: SQLException
if a database access error occurred.
Overrides:
clearBatch in class OracleStatement
 o executeBatch
 public synchronized int[] executeBatch() throws SQLException
Submit a batch of parameters to the database for execution.

Commands are executed in the order in which they were added to the batch. This method closes the calling Statement object's current set if one is open. The statement's internal list of batch commands is reset to empty once this method returns.

Returns:
an array containing one entry per each element in the batch. Each value is always -2.
Throws: BatchUpdateException
if any of the commands in the batch failed to execute properly. (For example, the batch will fail if it contained a command that returns a result set.)
Overrides:
executeBatch in class OracleStatement

All Packages  Class Hierarchy  This Package  Previous  Next  Index