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.
-
addBatch()
- Add a set of parameters to the batch.
-
addBatch(String)
- This method cannot be used in OraclePreparedStatement.
-
clearBatch()
- Make the set of parameters in the current batch empty.
-
clearParameters()
-
In general, parameter values remain in force for repeated use of a
Statement.
-
close()
- Close the prepared statement.
-
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.
-
execute()
- Execute the statement.
-
executeBatch()
- Submit a batch of parameters to the database for execution.
-
executeQuery()
- Execute the query statement.
-
executeUpdate()
- Execute the update statement.
-
getExecuteBatch()
- Retrieve the batch value (for Oracle-style batching only).
-
getMetaData()
- JDBC 2.0
Gets the number, types and properties of a ResultSet's columns.
-
sendBatch()
- Send any existing Oracle-style batch.
-
setArray(int, Array)
- JDBC 2.0.
-
setARRAY(int, ARRAY)
- Oracle specific.
-
setAsciiStream(int, InputStream, int)
- Sets the designated parameter to the given input stream, which will have
the specified number of bytes.
-
setBFILE(int, BFILE)
- Oracle specific.
-
setBfile(int, BFILE)
- Oracle specific.
-
setBigDecimal(int, BigDecimal)
- Sets the designated parameter to a java.lang.BigDecimal value.
-
setBinaryStream(int, InputStream, int)
- Sets the designated parameter to the given input stream, which will have
the specified number of bytes.
-
setBLOB(int, BLOB)
- Oracle specific.
-
setBlob(int, Blob)
- JDBC 2.0.
-
setBoolean(int, boolean)
- Sets the designated parameter to a Java boolean value.
-
setByte(int, byte)
- Sets the designated parameter to a Java byte value.
-
setBytes(int, byte[])
- Sets the designated parameter to a Java array of bytes.
-
setCHAR(int, CHAR)
- Oracle specific.
-
setCharacterStream(int, Reader, int)
- JDBC 2.0
Sets the designated parameter to the given
Reader
object, which is the given number of characters long.
-
setClob(int, Clob)
- JDBC 2.0.
-
setCLOB(int, CLOB)
- Oracle specific.
-
setCursor(int, ResultSet)
- Oracle specific.
-
setCustomDatum(int, CustomDatum)
- Oracle specific.
-
setDATE(int, DATE)
- Oracle specific.
-
setDate(int, Date)
- Sets the designated parameter to a java.sql.Date value.
-
setDate(int, Date, Calendar)
- JDBC 2.0
Sets the designated parameter to a java.sql.Date value,
using the given
Calendar
object.
-
setDouble(int, double)
- Sets the designated parameter to a Java double value.
-
setExecuteBatch(int)
- Set the batch value (for Oracle-style batching only).
-
setFixedCHAR(int, String)
- Use this method when binding to a CHAR column in the where
clause of a Select statement.
-
setFloat(int, float)
- Sets the designated parameter to a Java float value.
-
setInt(int, int)
- Sets the designated parameter to a Java int value.
-
setLong(int, long)
- Sets the designated parameter to a Java long value.
-
setNull(int, int)
- Sets the designated parameter to SQL NULL.
-
setNull(int, int, String)
- Implements JDBC 2.0 setNull for object types.
-
setNUMBER(int, NUMBER)
- Oracle specific.
-
setObject(int, Object)
- Sets the value of the designated parameter with the given object.
-
setObject(int, Object, int)
- Sets the value of the designated parameter with the given object.
-
setObject(int, Object, int, int)
-
Sets the value of a parameter using an object.
-
setOracleObject(int, Datum)
- Oracle specific.
-
setRAW(int, RAW)
- Oracle specific.
-
setRef(int, Ref)
- JDBC 2.0
Sets a Ref(<structured-type>) parameter.
-
setREF(int, REF)
- Oracle specific.
-
setRefType(int, REF)
- Oracle specific.
-
setROWID(int, ROWID)
- Oracle specific.
-
setShort(int, short)
- Sets the designated parameter to a Java short value.
-
setString(int, String)
- Sets the designated parameter to a Java String value.
-
setSTRUCT(int, STRUCT)
- Oracle specific.
-
setTime(int, Time)
- Sets the designated parameter to a java.sql.Time value.
-
setTime(int, Time, Calendar)
- JDBC 2.0
Sets the designated parameter to a java.sql.Time value,
using the given
Calendar
object.
-
setTimestamp(int, Timestamp)
- Sets the designated parameter to a java.sql.Timestamp value.
-
setTimestamp(int, Timestamp, Calendar)
- JDBC 2.0
Sets the designated parameter to a java.sql.Timestamp value,
using the given
Calendar
object.
-
setUnicodeStream(int, InputStream, int)
- Sets the designated parameter to the given input stream, which will have
the specified number of bytes.
Deprecated.
close
public synchronized void close() throws SQLException
- Close the prepared statement.
- Throws: SQLException
- if error(s) occurred.
- Overrides:
- close in class OracleStatement
executeQuery
public synchronized ResultSet executeQuery() throws SQLException
- Execute the query statement.
- Returns:
- the query result set.
- Throws: SQLException
- if error(s) occurred.
executeUpdate
public synchronized int executeUpdate() throws SQLException
- Execute the update statement.
- Throws: SQLException
- if error(s) occurred.
execute
public synchronized boolean execute() throws SQLException
- Execute the statement.
- Throws: SQLException
- if error(s) occurred.
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
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.
getExecuteBatch
public final int getExecuteBatch()
- Retrieve the batch value (for Oracle-style batching only).
- Returns:
- the batch value last set by setExecuteBatch().
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.
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
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
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
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
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
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
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
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
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
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
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
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
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.
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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.
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
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).
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).
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).
addBatch
public synchronized void addBatch() throws SQLException
- Add a set of parameters to the batch.
- Throws: SQLException
- if an error occurred.
addBatch
public synchronized void addBatch(String sql) throws SQLException
- This method cannot be used in OraclePreparedStatement.
- Overrides:
- addBatch in class OracleStatement
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
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