|
Oracle10g JDBC | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectoracle.jdbc.driver.OracleStatement
oracle.jdbc.driver.OraclePreparedStatement
Oracle prepared statement class.
Field Summary | |
static java.lang.String |
BUILD_DATE
|
static boolean |
PRIVATE_TRACE
|
static boolean |
TRACE
|
static int |
TypeBinder_BYTELEN
|
Fields inherited from interface oracle.jdbc.OraclePreparedStatement |
FORM_CHAR, FORM_NCHAR |
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 |
Fields inherited from interface oracle.jdbc.OracleStatement |
EXPLICIT, IMPLICIT, NEW |
Fields inherited from interface oracle.jdbc.internal.OracleStatement |
ACTIVE, CACHED, CLOSED, DEFAULT_RSET_TYPE, NON_CACHED |
Method Summary | |
void |
addBatch()
Add a set of parameters to the batch. |
void |
addBatch(java.lang.String sql)
This method cannot be used in OraclePreparedStatement. |
void |
clearBatch()
Make the set of parameters in the current batch empty. |
void |
clearParameters()
In general, parameter values remain in force for repeated use of a Statement. |
void |
closeWithKey(java.lang.String key)
The underlying cursor is not closed and the Statement handle is cached on the Key. |
void |
defineParameterType(int param_index,
int type,
int max_size)
Define the type under which you will bind the parameter and the maximum size (in characters) of data you will bind in binds. |
void |
defineParameterTypeBytes(int param_index,
int type,
int max_size)
Define the type under which you will bind the parameter and the maximum size (in bytes) of data you will bind in binds. |
void |
defineParameterTypeChars(int param_index,
int type,
int max_size)
Define the type under which you will bind the parameter and the maximum size (in characters) of data you will bind in binds. |
void |
enterExplicitCache()
enterExplicitCache This method is called by LRUStatementCache when this statement is about to be put into the explicit cache. |
boolean |
execute()
Execute the statement. |
int[] |
executeBatch()
Submit a batch of parameters to the database for execution. |
java.sql.ResultSet |
executeQuery()
Execute the query statement. |
int |
executeUpdate()
Execute the update statement. |
void |
exitExplicitCacheToActive()
exitExplicitCacheToActive This method is called by LRUStatementCache when this statement is retrieved from the explicit cache, and is about to be reused. |
void |
exitExplicitCacheToClose()
exitExplicitCacheToClose() This method is called by LRUStatementCache when this statement is about to be closed directly from the explicit cache. |
void |
exitImplicitCacheToActive()
exitImplicitCacheToActive This method is called by LRUStatementCache when this statement is retrieved from the implicit cache, and is about to be reused. |
void |
exitImplicitCacheToClose()
exitImplicitCacheToClose() This method is called by LRUStatementCache when this statement is about to be closed directly from the implicit cache. |
boolean |
getAutoRefetch()
Oracle extension. |
java.sql.Connection |
getConnection()
JDBC 2.0 Returns the Connection object
that produced this Statement object. |
int |
getExecuteBatch()
Retrieve the batch value (for Oracle-style batching only). |
int |
getMaxFieldSize()
|
java.sql.ResultSetMetaData |
getMetaData()
JDBC 2.0 Gets the number, types and properties of a ResultSet's columns. |
java.lang.String |
getOriginalSql()
|
java.sql.ParameterMetaData |
getParameterMetaData()
|
oracle.jdbc.driver.OracleResultSetCache |
getResultSetCache()
|
java.lang.String |
getRevisedSql()
|
void |
notify_close_rset()
|
OracleParameterMetaData |
OracleGetParameterMetaData()
Oracle extension Retrieves the number, types and properties of this oracle.jdbc.PreparedStatement object's parameters. |
int |
sendBatch()
Send any existing Oracle-style batch. |
void |
setArray(int paramIndex,
java.sql.Array arr)
JDBC 2.0. |
void |
setARRAY(int paramIndex,
ARRAY arr)
Oracle specific. |
void |
setArrayAtName(java.lang.String paramName,
java.sql.Array x)
Sets the designated parameter to an Array value. |
void |
setARRAYAtName(java.lang.String paramName,
ARRAY x)
Sets the designated parameter to an oracle.sql.ARRAY |
void |
setAsciiStream(int paramIndex,
java.io.InputStream istream,
int length)
Sets the designated parameter to the given input stream, which will have the specified number of bytes. |
void |
setAsciiStreamAtName(java.lang.String paramName,
java.io.InputStream stream,
int length)
Sets the designated parameter to a the value read from a stream. |
void |
setAutoRefetch(boolean)
Oracle extension. |
void |
setBfile(int paramIndex,
BFILE file)
Oracle specific. |
void |
setBFILE(int paramIndex,
BFILE file)
Oracle specific. |
void |
setBfileAtName(java.lang.String paramName,
BFILE x)
Sets the designated parameter to an oracle.sql.BFILE |
void |
setBFILEAtName(java.lang.String paramName,
BFILE x)
Sets the designated parameter to an oracle.sql.BFILE |
void |
setBigDecimal(int paramIndex,
java.math.BigDecimal x)
Sets the designated parameter to a java.math.BigDecimal value. |
void |
setBigDecimalAtName(java.lang.String paramName,
java.math.BigDecimal x)
Sets the designated parameter to a Java BigDecimal value. |
void |
setBinaryDouble(int paramIndex,
BINARY_DOUBLE bd)
Sets the designated parameter to an oracle.sql.BINARY_DOUBLE value. |
void |
setBinaryDouble(int paramIndex,
double x)
Sets the designated parameter to a Java double value. |
void |
setBinaryDoubleAtName(java.lang.String paramName,
BINARY_DOUBLE x)
Sets the designated parameter to a BINARY_DOUBLE value. |
void |
setBinaryDoubleAtName(java.lang.String paramName,
double x)
Sets the designated parameter to a Java double value. |
void |
setBinaryFloat(int paramIndex,
BINARY_FLOAT bf)
Sets the designated parameter to an oracle.sql.BINARY_FLOAT value. |
void |
setBinaryFloat(int paramIndex,
float x)
Sets the designated BINARY_FLOAT parameter to a Java float value. |
void |
setBinaryFloatAtName(java.lang.String paramName,
BINARY_FLOAT x)
Sets the designated parameter to a oracle.sql.BINARY_FLOAT value. |
void |
setBinaryFloatAtName(java.lang.String paramName,
float x)
Sets the designated parameter to a Java float value. |
void |
setBinaryStream(int paramIndex,
java.io.InputStream istream,
int length)
Sets the designated parameter to the given input stream, which will have the specified number of bytes. |
void |
setBinaryStreamAtName(java.lang.String paramName,
java.io.InputStream stream,
int length)
Sets the designated parameter to the value in a stream. |
void |
setBlob(int paramIndex,
java.sql.Blob lob)
JDBC 2.0. |
void |
setBLOB(int paramIndex,
BLOB lob)
Oracle specific. |
void |
setBlobAtName(java.lang.String paramName,
java.sql.Blob x)
Sets the designated parameter to a Java Blob value. |
void |
setBLOBAtName(java.lang.String paramName,
BLOB x)
Sets the designated parameter to an oracle.sql.BLOB. |
void |
setBoolean(int paramIndex,
boolean x)
Sets the designated parameter to a Java boolean value. |
void |
setBooleanAtName(java.lang.String paramName,
boolean x)
Sets the designated parameter to a Java boolean value. |
void |
setByte(int paramIndex,
byte x)
Sets the designated parameter to a Java byte value. |
void |
setByteAtName(java.lang.String paramName,
byte x)
Sets the designated parameter to a Java byte value. |
void |
setBytes(int paramIndex,
byte[] x)
Sets the designated parameter to a Java array of bytes. |
void |
setBytesAtName(java.lang.String paramName,
byte[] x)
Sets the designated parameter to a Java array of bytes. |
void |
setCHAR(int paramIndex,
CHAR ch)
Oracle specific. |
void |
setCharacterStream(int paramIndex,
java.io.Reader reader,
int length)
JDBC 2.0 Sets the designated parameter to the given Reader
object, which is the given number of characters long. |
void |
setCHARAtName(java.lang.String paramName,
CHAR x)
Sets the designated parameter to an oracle.sql.CHAR |
void |
setClob(int paramIndex,
java.sql.Clob lob)
JDBC 2.0. |
void |
setCLOB(int paramIndex,
CLOB lob)
Oracle specific. |
void |
setClobAtName(java.lang.String paramName,
java.sql.Clob x)
Sets the designated parameter to a Java Clob value. |
void |
setCLOBAtName(java.lang.String paramName,
CLOB x)
Sets the designated parameter to an oracle.sql.CLOB. |
void |
setCursorAtName(java.lang.String paramName,
java.sql.ResultSet x)
Sets the designated parameter to a java.sql.ResultSet. |
void |
setCustomDatum(int paramIndex,
CustomDatum x)
Deprecated. |
void |
setCustomDatumAtName(java.lang.String paramName,
CustomDatum x)
Sets the designated parameter to an oracle.sql.CustomDatum. |
void |
setDate(int paramIndex,
java.sql.Date x)
Sets the designated parameter to a java.sql.Date value. |
void |
setDATE(int paramIndex,
DATE date)
Oracle specific. |
void |
setDate(int paramIndex,
java.sql.Date x,
java.util.Calendar cal)
JDBC 2.0 Sets the designated parameter to a java.sql.Date value, using the given Calendar object. |
void |
setDateAtName(java.lang.String paramName,
java.sql.Date x)
Sets the designated parameter to a Java Date value. |
void |
setDATEAtName(java.lang.String paramName,
DATE x)
Sets the designated parameter to an oracle.sql.DATE. |
void |
setDisableStmtCaching(boolean cache)
Don't Cache this object even when the corresponding Connection is Cache Enabled. |
void |
setDouble(int paramIndex,
double x)
Sets the designated parameter to a Java double value. |
void |
setDoubleAtName(java.lang.String paramName,
double x)
Sets the designated parameter to a Java double value. |
void |
setEscapeProcessing(boolean enable)
|
void |
setExecuteBatch(int batchValue)
Set the batch value (for Oracle-style batching only). |
void |
setFixedCHAR(int paramIndex,
java.lang.String x)
Use this method when binding to a CHAR column in the where clause of a Select statement. |
void |
setFixedCHARAtName(java.lang.String paramName,
java.lang.String x)
Sets the designated parameter to a fixed length CHAR value. |
void |
setFloat(int paramIndex,
float x)
Sets the designated parameter to a Java float value. |
void |
setFloatAtName(java.lang.String paramName,
float x)
Sets the designated parameter to a Java float value. |
void |
setFormOfUse(int paramIndex,
short formOfUse)
Sets the "Form Of Use". |
void |
setInt(int paramIndex,
int x)
Sets the designated parameter to a Java int value. |
void |
setIntAtName(java.lang.String paramName,
int x)
Sets the designated parameter to a Java int value. |
void |
setINTERVALDS(int paramIndex,
INTERVALDS x)
Sets the designated parameter to an oracle.sql.INTERVALDS value. |
void |
setINTERVALDSAtName(java.lang.String paramName,
INTERVALDS x)
Sets the designated parameter to a oracle.sql.INTERVALDS. |
void |
setINTERVALYM(int paramIndex,
INTERVALYM x)
Sets the designated parameter to an oracle.sql.INTERVALYM value. |
void |
setINTERVALYMAtName(java.lang.String paramName,
INTERVALYM x)
Sets the designated parameter to an oracle.sql.INTERVALYM. |
void |
setLong(int paramIndex,
long x)
Sets the designated parameter to a Java long value. |
void |
setLongAtName(java.lang.String paramName,
long x)
Sets the designated parameter to a Java long value. |
void |
setNull(int paramIndex,
int sqlType)
Sets the designated parameter to SQL NULL. |
void |
setNull(int paramIndex,
int sqlType,
java.lang.String sqlName)
Implements JDBC 2.0 setNull for object types. |
void |
setNullAtName(java.lang.String paramName,
int sqlType)
Sets the designated parameter to NULL. |
void |
setNullAtName(java.lang.String paramName,
int sqlType,
java.lang.String sqlName)
Sets the designated parameter to Null |
void |
setNUMBER(int paramIndex,
NUMBER num)
Oracle specific. |
void |
setNUMBERAtName(java.lang.String paramName,
NUMBER x)
Sets the designated parameter to an oracle.sql.NUMBER. |
void |
setObject(int paramIndex,
java.lang.Object x)
Sets the value of the designated parameter with the given object. |
void |
setObject(int paramIndex,
java.lang.Object x,
int targetSqlType)
Sets the value of the designated parameter with the given object. |
void |
setObject(int paramIndex,
java.lang.Object x,
int targetSqlType,
int scale)
Sets the value of a parameter using an object. |
void |
setObjectAtName(java.lang.String paramName,
java.lang.Object x)
Sets the designated parameter to a Java Object. |
void |
setObjectAtName(java.lang.String paramName,
java.lang.Object x,
int targetSqlType)
Sets the designated parameter to a Java Object. |
void |
setObjectAtName(java.lang.String paramName,
java.lang.Object x,
int targetSqlType,
int scale)
Sets the designated parameter to a Java Object |
void |
setOPAQUE(int paramIndex,
OPAQUE opaque)
Oracle specific. |
void |
setOPAQUEAtName(java.lang.String paramName,
OPAQUE x)
Sets the designated parameter to an oracle.sql.OPAQUE. |
void |
setOracleObject(int paramIndex,
Datum x)
Oracle specific. |
void |
setOracleObjectAtName(java.lang.String paramName,
Datum x)
Sets the designated parameter to an oracle.sql.Datum. |
void |
setORAData(int paramIndex,
ORAData x)
Set the designated parameter to an oracle.sql.ORAData value. |
void |
setORADataAtName(java.lang.String paramName,
ORAData x)
Sets the designated parameter to an oracle.sql.ORAData. |
void |
setPlsqlIndexTable(int paramIndex,
java.lang.Object arrayData,
int maxLen,
int curLen,
int elemSqlType,
int elemMaxLen)
Oracle OCI driver specific. |
void |
setPlsqlIndexTableAtName(java.lang.String paramName,
java.lang.Object arrayData,
int maxLen,
int curLen,
int elemSqlType,
int elemMaxLen)
Sets the designated parameter to a Java int value. |
void |
setRAW(int paramIndex,
RAW raw)
Oracle specific. |
void |
setRAWAtName(java.lang.String paramName,
RAW x)
Sets the designated parameter to an oracle.sql.RAW. |
void |
setRef(int paramIndex,
java.sql.Ref ref)
JDBC 2.0 Sets a Ref(<structured-type>) parameter. |
void |
setREF(int paramIndex,
REF ref)
Oracle specific. |
void |
setRefAtName(java.lang.String paramName,
java.sql.Ref x)
Sets the designated parameter to a Ref. |
void |
setREFAtName(java.lang.String paramName,
REF x)
Sets the designated parameter to an oracle.sql.REF. |
void |
setRefType(int paramIndex,
REF ref)
Oracle specific. |
void |
setRefTypeAtName(java.lang.String paramName,
REF x)
Sets the designated parameter to an oracle.sql.REF value. |
void |
setROWID(int paramIndex,
ROWID rowid)
Oracle specific. |
void |
setROWIDAtName(java.lang.String paramName,
ROWID x)
Sets the designated parameter to a oracle.sql.ROWID. |
void |
setShort(int paramIndex,
short x)
Sets the designated parameter to a Java short value. |
void |
setShortAtName(java.lang.String paramName,
short x)
Sets the designated parameter to a Java short value. |
void |
setString(int paramIndex,
java.lang.String x)
Sets the designated parameter to a Java String value. |
void |
setStringAtName(java.lang.String paramName,
java.lang.String x)
Sets the designated parameter to a Java String value. |
void |
setStringForClob(int paramIndex,
java.lang.String x)
Sets the designated parameter to a Java String value. |
void |
setStringForClobAtName(java.lang.String paramName,
java.lang.String x)
Sets the designated parameter to a Java String value. |
void |
setSTRUCT(int paramIndex,
STRUCT struct)
Oracle specific. |
void |
setSTRUCTAtName(java.lang.String paramName,
STRUCT x)
Sets the designated parameter to an oracle.sql.STRUCT. |
void |
setStructDescriptor(int paramIndex,
StructDescriptor desc)
Oracle specific. |
void |
setStructDescriptorAtName(java.lang.String paramName,
StructDescriptor desc)
Sets the bind type of the designated parameter from an oracle.sql.StructDescriptor. |
void |
setTime(int paramIndex,
java.sql.Time x)
Sets the designated parameter to a java.sql.Time value. |
void |
setTime(int paramIndex,
java.sql.Time x,
java.util.Calendar cal)
JDBC 2.0 Sets the designated parameter to a java.sql.Time value, using the given Calendar object. |
void |
setTimeAtName(java.lang.String paramName,
java.sql.Time x)
Sets the designated parameter to a Java Time value. |
void |
setTimestamp(int paramIndex,
java.sql.Timestamp x)
Sets the designated parameter to a java.sql.Timestamp value. |
void |
setTIMESTAMP(int paramIndex,
TIMESTAMP x)
Sets the designated parameter to an oracle.sql.TIMESTAMP value. |
void |
setTimestamp(int paramIndex,
java.sql.Timestamp x,
java.util.Calendar cal)
JDBC 2.0 Sets the designated parameter to a java.sql.Timestamp value, using the given Calendar object. |
void |
setTimestampAtName(java.lang.String paramName,
java.sql.Timestamp x)
Sets the designated parameter to a Java Timestamp value. |
void |
setTIMESTAMPAtName(java.lang.String paramName,
TIMESTAMP x)
Sets the designated parameter to an oracle.sql.TIMESTAMP |
void |
setTIMESTAMPLTZ(int paramIndex,
TIMESTAMPLTZ x)
Sets the designated parameter to an oracle.sql.TIMESTAMPLTZ value. |
void |
setTIMESTAMPLTZAtName(java.lang.String paramName,
TIMESTAMPLTZ x)
Sets the designated parameter to an oracle.sql.TIMESTAMPLTZ. |
void |
setTIMESTAMPTZ(int paramIndex,
TIMESTAMPTZ x)
Sets the designated parameter to an oracle.sql.TIMESTAMPTZ value. |
void |
setTIMESTAMPTZAtName(java.lang.String paramName,
TIMESTAMPTZ x)
Sets the designated parameter to an oracle.sql.TIMESTAMPTZ. |
void |
setUnicodeStream(int paramIndex,
java.io.InputStream istream,
int length)
Deprecated. |
void |
setUnicodeStreamAtName(java.lang.String paramName,
java.io.InputStream stream,
int length)
Sets the designated parameter to the value in a stream. |
void |
setURL(int paramIndex,
java.net.URL x)
JDBC 3.0 Sets the designated parameter to the given java.net.URL value. |
void |
setURLAtName(java.lang.String paramName,
java.net.URL x)
Oracle extension Sets the designated parameter to a java.net.URL value. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.sql.Statement |
cancel, clearWarnings, close, execute, execute, execute, execute, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, setCursorName, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setQueryTimeout |
Methods inherited from interface oracle.jdbc.OracleStatement |
clearDefines, creationState, defineColumnType, defineColumnType, defineColumnType, defineColumnType, defineColumnTypeBytes, defineColumnTypeChars, getRowPrefetch, isNCHAR, setResultSetCache, setRowPrefetch |
Methods inherited from interface oracle.jdbc.internal.OracleStatement |
getcacheState, getFixedString, getserverCursor, getstatementType, setFixedString |
Field Detail |
public static final int TypeBinder_BYTELEN
public static final boolean TRACE
public static final boolean PRIVATE_TRACE
public static final java.lang.String BUILD_DATE
Method Detail |
public void enterExplicitCache() throws java.sql.SQLException
enterExplicitCache
in interface oracle.jdbc.internal.OraclePreparedStatement
java.sql.SQLException
public void exitImplicitCacheToActive() throws java.sql.SQLException
exitImplicitCacheToActive
in interface oracle.jdbc.internal.OraclePreparedStatement
java.sql.SQLException
public void exitExplicitCacheToActive() throws java.sql.SQLException
exitExplicitCacheToActive
in interface oracle.jdbc.internal.OraclePreparedStatement
java.sql.SQLException
public void exitImplicitCacheToClose() throws java.sql.SQLException
exitImplicitCacheToClose
in interface oracle.jdbc.internal.OraclePreparedStatement
java.sql.SQLException
public void exitExplicitCacheToClose() throws java.sql.SQLException
exitExplicitCacheToClose
in interface oracle.jdbc.internal.OraclePreparedStatement
java.sql.SQLException
public void closeWithKey(java.lang.String key) throws java.sql.SQLException
closeWithKey
in interface OracleStatement
closeWithKey
in class OracleStatement
key
- A key to tag to the statement to be retrieved later
java.sql.SQLException
- if a database access error occurspublic java.sql.ResultSet executeQuery() throws java.sql.SQLException
executeQuery
in interface java.sql.PreparedStatement
java.sql.SQLException
- if error(s) occurred.public int executeUpdate() throws java.sql.SQLException
executeUpdate
in interface java.sql.PreparedStatement
java.sql.SQLException
- if error(s) occurred.public boolean execute() throws java.sql.SQLException
execute
in interface java.sql.PreparedStatement
java.sql.SQLException
- if error(s) occurred.public int sendBatch() throws java.sql.SQLException
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
OraclePreparedStatement
.
sendBatch
in interface OraclePreparedStatement
sendBatch
in class OracleStatement
java.sql.SQLException
- if an error occurred.public void setEscapeProcessing(boolean enable) throws java.sql.SQLException
setEscapeProcessing
in interface java.sql.Statement
setEscapeProcessing
in class OracleStatement
java.sql.SQLException
public void setExecuteBatch(int batchValue) throws java.sql.SQLException
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
OraclePreparedStatement
.
setExecuteBatch
in interface OraclePreparedStatement
batchValue
- batch value to be set. It must be greater than or
equal to 1.
java.sql.SQLException
- is batchValue
is <1getExecuteBatch
,
OracleConnection.setDefaultExecuteBatch
public final int getExecuteBatch()
getExecuteBatch
in interface OraclePreparedStatement
OracleConnection.setDefaultExecuteBatch
,
setExecuteBatch
public void defineParameterTypeBytes(int param_index, int type, int max_size) throws java.sql.SQLException
Similar 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. Also, you cannot use this for LONG types.
defineParameterTypeBytes
in interface OraclePreparedStatement
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.
java.sql.SQLException
- if the type you specify is not availablepublic void defineParameterTypeChars(int param_index, int type, int max_size) throws java.sql.SQLException
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 OracleTypes.CHAR
as the type
value if you are going bind later as setCHAR
and use
OracleTypes.VARCHAR
if you are going to bind as
setString
for effective results.
defineParameterTypeChars
in interface OraclePreparedStatement
param_index
- Index of bind parameter (should be >=0)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
(should be >=0)
java.sql.SQLException
- if the type you specify is not availablepublic void defineParameterType(int param_index, int type, int max_size) throws java.sql.SQLException
defineParameterType
in interface OraclePreparedStatement
java.sql.SQLException
public java.sql.ResultSetMetaData getMetaData() throws java.sql.SQLException
getMetaData
in interface java.sql.PreparedStatement
java.sql.SQLException
- if a database access error occurspublic void setNull(int paramIndex, int sqlType, java.lang.String sqlName) throws java.sql.SQLException
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.
setNull
in interface java.sql.PreparedStatement
sqlType
- a value from java.sql.Types
java.sql.SQLException
- if a database access error occurspublic void setNullAtName(java.lang.String paramName, int sqlType, java.lang.String sqlName) throws java.sql.SQLException
setNullAtName
in interface OraclePreparedStatement
sqlType
- sqlName
- paramName
-
java.sql.SQLException
- if a database access error occurspublic void setNull(int paramIndex, int sqlType) throws java.sql.SQLException
Note: You must specify the parameter's SQL type.
setNull
in interface java.sql.PreparedStatement
sqlType
- the SQL type code defined in java.sql.Types
java.sql.SQLException
- if a database access error occurspublic void setNullAtName(java.lang.String paramName, int sqlType) throws java.sql.SQLException
setNullAtName
in interface OraclePreparedStatement
sqlType
- paramName
-
java.sql.SQLException
- if a database access error occurspublic void setBoolean(int paramIndex, boolean x) throws java.sql.SQLException
setBoolean
in interface java.sql.PreparedStatement
x
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setBooleanAtName(java.lang.String paramName, boolean x) throws java.sql.SQLException
setBooleanAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setByte(int paramIndex, byte x) throws java.sql.SQLException
setByte
in interface java.sql.PreparedStatement
x
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setByteAtName(java.lang.String paramName, byte x) throws java.sql.SQLException
setByteAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setShort(int paramIndex, short x) throws java.sql.SQLException
setShort
in interface java.sql.PreparedStatement
x
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setShortAtName(java.lang.String paramName, short x) throws java.sql.SQLException
setShortAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setInt(int paramIndex, int x) throws java.sql.SQLException
setInt
in interface java.sql.PreparedStatement
x
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setIntAtName(java.lang.String paramName, int x) throws java.sql.SQLException
setIntAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setLong(int paramIndex, long x) throws java.sql.SQLException
setLong
in interface java.sql.PreparedStatement
x
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setLongAtName(java.lang.String paramName, long x) throws java.sql.SQLException
setLongAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setFloat(int paramIndex, float x) throws java.sql.SQLException
setFloat
in interface java.sql.PreparedStatement
x
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setBinaryFloat(int paramIndex, float x) throws java.sql.SQLException
setBinaryFloat
in interface OraclePreparedStatement
x
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setBinaryFloatAtName(java.lang.String paramName, float x) throws java.sql.SQLException
setBinaryFloatAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setBinaryFloat(int paramIndex, BINARY_FLOAT bf) throws java.sql.SQLException
OraclePreparedStatement
setBinaryFloat
in interface OraclePreparedStatement
bf
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setBinaryFloatAtName(java.lang.String paramName, BINARY_FLOAT x) throws java.sql.SQLException
setBinaryFloatAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setBinaryDouble(int paramIndex, double x) throws java.sql.SQLException
setBinaryDouble
in interface OraclePreparedStatement
x
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setBinaryDouble(int paramIndex, BINARY_DOUBLE bd) throws java.sql.SQLException
setBinaryDouble
in interface OraclePreparedStatement
bd
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setBinaryDoubleAtName(java.lang.String paramName, double x) throws java.sql.SQLException
setBinaryDoubleAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setFloatAtName(java.lang.String paramName, float x) throws java.sql.SQLException
setFloatAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setBinaryDoubleAtName(java.lang.String paramName, BINARY_DOUBLE x) throws java.sql.SQLException
setBinaryDoubleAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setDouble(int paramIndex, double x) throws java.sql.SQLException
setDouble
in interface java.sql.PreparedStatement
x
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setDoubleAtName(java.lang.String paramName, double x) throws java.sql.SQLException
setDoubleAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setBigDecimal(int paramIndex, java.math.BigDecimal x) throws java.sql.SQLException
setBigDecimal
in interface java.sql.PreparedStatement
x
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setBigDecimalAtName(java.lang.String paramName, java.math.BigDecimal x) throws java.sql.SQLException
setBigDecimalAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setString(int paramIndex, java.lang.String x) throws java.sql.SQLException
setString
in interface java.sql.PreparedStatement
x
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setStringAtName(java.lang.String paramName, java.lang.String x) throws java.sql.SQLException
setStringAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setStringForClob(int paramIndex, java.lang.String x) throws java.sql.SQLException
setStringForClob
in interface OraclePreparedStatement
x
- the parameter valueparamIndex
-
java.sql.SQLException
- if a database access error occurspublic void setStringForClobAtName(java.lang.String paramName, java.lang.String x) throws java.sql.SQLException
setStringForClobAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setFixedCHAR(int paramIndex, java.lang.String x) throws java.sql.SQLException
setFixedCHAR
in interface OraclePreparedStatement
paramIndex
- index of the bind variablex
- the literal/variable to be bound.
java.sql.SQLException
- error while bindingsetCHAR
public void setFixedCHARAtName(java.lang.String paramName, java.lang.String x) throws java.sql.SQLException
setFixedCHARAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setCursorAtName(java.lang.String paramName, java.sql.ResultSet x) throws java.sql.SQLException
setCursorAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setROWID(int paramIndex, ROWID rowid) throws java.sql.SQLException
setROWID
in interface OraclePreparedStatement
rowid
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setROWIDAtName(java.lang.String paramName, ROWID x) throws java.sql.SQLException
setROWIDAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setArray(int paramIndex, java.sql.Array arr) throws java.sql.SQLException
setArray
in interface java.sql.PreparedStatement
java.sql.SQLException
- if a database access error occurspublic void setArrayAtName(java.lang.String paramName, java.sql.Array x) throws java.sql.SQLException
setArrayAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setARRAY(int paramIndex, ARRAY arr) throws java.sql.SQLException
setARRAY
in interface OraclePreparedStatement
arr
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setARRAYAtName(java.lang.String paramName, ARRAY x) throws java.sql.SQLException
setARRAYAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setOPAQUE(int paramIndex, OPAQUE opaque) throws java.sql.SQLException
setOPAQUE
in interface OraclePreparedStatement
opaque
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setOPAQUEAtName(java.lang.String paramName, OPAQUE x) throws java.sql.SQLException
setOPAQUEAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setStructDescriptor(int paramIndex, StructDescriptor desc) throws java.sql.SQLException
setStructDescriptor
in interface OraclePreparedStatement
java.sql.SQLException
- if a database access error occurspublic void setStructDescriptorAtName(java.lang.String paramName, StructDescriptor desc) throws java.sql.SQLException
setStructDescriptorAtName
in interface OraclePreparedStatement
desc
- the StructDescriptorparamName
-
java.sql.SQLException
- if a database access error occurspublic void setSTRUCT(int paramIndex, STRUCT struct) throws java.sql.SQLException
setSTRUCT
in interface OraclePreparedStatement
struct
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setSTRUCTAtName(java.lang.String paramName, STRUCT x) throws java.sql.SQLException
setSTRUCTAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setRAW(int paramIndex, RAW raw) throws java.sql.SQLException
setRAW
in interface OraclePreparedStatement
raw
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setRAWAtName(java.lang.String paramName, RAW x) throws java.sql.SQLException
setRAWAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setCHAR(int paramIndex, CHAR ch) throws java.sql.SQLException
setCHAR
in interface OraclePreparedStatement
ch
- the parameter value
java.sql.SQLException
- if a database access error occurssetFixedChar
public void setCHARAtName(java.lang.String paramName, CHAR x) throws java.sql.SQLException
setCHARAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setDATE(int paramIndex, DATE date) throws java.sql.SQLException
setDATE
in interface OraclePreparedStatement
date
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setDATEAtName(java.lang.String paramName, DATE x) throws java.sql.SQLException
setDATEAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setNUMBER(int paramIndex, NUMBER num) throws java.sql.SQLException
setNUMBER
in interface OraclePreparedStatement
num
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setNUMBERAtName(java.lang.String paramName, NUMBER x) throws java.sql.SQLException
setNUMBERAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setBLOB(int paramIndex, BLOB lob) throws java.sql.SQLException
setBLOB
in interface OraclePreparedStatement
lob
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setBLOBAtName(java.lang.String paramName, BLOB x) throws java.sql.SQLException
setBLOBAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setBlob(int paramIndex, java.sql.Blob lob) throws java.sql.SQLException
setBlob
in interface java.sql.PreparedStatement
java.sql.SQLException
- if a database access error occurspublic void setBlobAtName(java.lang.String paramName, java.sql.Blob x) throws java.sql.SQLException
setBlobAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setCLOB(int paramIndex, CLOB lob) throws java.sql.SQLException
setCLOB
in interface OraclePreparedStatement
lob
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setCLOBAtName(java.lang.String paramName, CLOB x) throws java.sql.SQLException
setCLOBAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setClob(int paramIndex, java.sql.Clob lob) throws java.sql.SQLException
setClob
in interface java.sql.PreparedStatement
java.sql.SQLException
- if a database access error occurspublic void setClobAtName(java.lang.String paramName, java.sql.Clob x) throws java.sql.SQLException
setClobAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setBFILE(int paramIndex, BFILE file) throws java.sql.SQLException
setBFILE
in interface OraclePreparedStatement
file
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setBFILEAtName(java.lang.String paramName, BFILE x) throws java.sql.SQLException
setBFILEAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setBfile(int paramIndex, BFILE file) throws java.sql.SQLException
setBfile
in interface OraclePreparedStatement
file
- the parameter value
java.sql.SQLException
- if a database access error occurssetBFILE
public void setBfileAtName(java.lang.String paramName, BFILE x) throws java.sql.SQLException
setBfileAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setBytes(int paramIndex, byte[] x) throws java.sql.SQLException
setBytes
in interface java.sql.PreparedStatement
x
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setBytesAtName(java.lang.String paramName, byte[] x) throws java.sql.SQLException
setBytesAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setDate(int paramIndex, java.sql.Date x) throws java.sql.SQLException
setDate
in interface java.sql.PreparedStatement
x
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setDateAtName(java.lang.String paramName, java.sql.Date x) throws java.sql.SQLException
setDateAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setTime(int paramIndex, java.sql.Time x) throws java.sql.SQLException
setTime
in interface java.sql.PreparedStatement
x
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setTimeAtName(java.lang.String paramName, java.sql.Time x) throws java.sql.SQLException
setTimeAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setTimestamp(int paramIndex, java.sql.Timestamp x) throws java.sql.SQLException
setTimestamp
in interface java.sql.PreparedStatement
x
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setTimestampAtName(java.lang.String paramName, java.sql.Timestamp x) throws java.sql.SQLException
setTimestampAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setINTERVALYM(int paramIndex, INTERVALYM x) throws java.sql.SQLException
setINTERVALYM
in interface OraclePreparedStatement
paramIndex
- specifies the parameter index. Index starts from 1.x
- specifies the parameter value.
java.sql.SQLException
- if an error occurred.public void setINTERVALYMAtName(java.lang.String paramName, INTERVALYM x) throws java.sql.SQLException
setINTERVALYMAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setINTERVALDS(int paramIndex, INTERVALDS x) throws java.sql.SQLException
setINTERVALDS
in interface OraclePreparedStatement
paramIndex
- specifies the parameter index. Index starts from 1.x
- specifies the parameter value.
java.sql.SQLException
- if an error occurred.public void setINTERVALDSAtName(java.lang.String paramName, INTERVALDS x) throws java.sql.SQLException
setINTERVALDSAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setTIMESTAMP(int paramIndex, TIMESTAMP x) throws java.sql.SQLException
setTIMESTAMP
in interface OraclePreparedStatement
paramIndex
- specifies the parameter index. Index starts from 1.x
- specifies the parameter value.
java.sql.SQLException
- if an error occurred.public void setTIMESTAMPAtName(java.lang.String paramName, TIMESTAMP x) throws java.sql.SQLException
setTIMESTAMPAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setTIMESTAMPTZ(int paramIndex, TIMESTAMPTZ x) throws java.sql.SQLException
setTIMESTAMPTZ
in interface OraclePreparedStatement
paramIndex
- specifies the parameter index. Index starts from 1.x
- specifies the parameter value.
java.sql.SQLException
- if an error occurred.public void setTIMESTAMPTZAtName(java.lang.String paramName, TIMESTAMPTZ x) throws java.sql.SQLException
setTIMESTAMPTZAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setTIMESTAMPLTZ(int paramIndex, TIMESTAMPLTZ x) throws java.sql.SQLException
In order to use this method, the calling program must first invoke OracleConnection.setSessionTimeZone() to set the session time zone.
setTIMESTAMPLTZ
in interface OraclePreparedStatement
paramIndex
- specifies the parameter index. Index starts from 1.x
- specifies the parameter value.
java.sql.SQLException
- if an error occurred.public void setTIMESTAMPLTZAtName(java.lang.String paramName, TIMESTAMPLTZ x) throws java.sql.SQLException
setTIMESTAMPLTZAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setAsciiStream(int paramIndex, java.io.InputStream istream, int length) throws java.sql.SQLException
Note: There are restrictions to use this method for CLOBs. Please see details in Oracle JDBC documents or Readme to avoid data lossage.
setAsciiStream
in interface java.sql.PreparedStatement
istream
- the Java input stream that contains the ASCII parameter valuelength
- the number of bytes in the stream
java.sql.SQLException
- if a database access error occurspublic void setAsciiStreamAtName(java.lang.String paramName, java.io.InputStream stream, int length) throws java.sql.SQLException
setAsciiStreamAtName
in interface OraclePreparedStatement
stream
- length
- paramName
-
java.sql.SQLException
- if a database access error occurspublic void setBinaryStream(int paramIndex, java.io.InputStream istream, int length) throws java.sql.SQLException
Note: There are restrictions to use this method for BLOBs. Please see details in Oracle JDBC documents or Readme to avoid data lossage.
setBinaryStream
in interface java.sql.PreparedStatement
istream
- the java input stream which contains the binary parameter valuelength
- the number of bytes in the stream
java.sql.SQLException
- if a database access error occurspublic void setBinaryStreamAtName(java.lang.String paramName, java.io.InputStream stream, int length) throws java.sql.SQLException
setBinaryStreamAtName
in interface OraclePreparedStatement
stream
- length
- paramName
-
java.sql.SQLException
- if a database access error occurspublic void setUnicodeStream(int paramIndex, java.io.InputStream istream, int length) throws java.sql.SQLException
Note: There are restrictions to use this method for CLOBs. Please see details in Oracle JDBC documents or Readme to avoid data lossage.
setUnicodeStream
in interface java.sql.PreparedStatement
istream
- the java input stream which contains the
UNICODE parameter valuelength
- the number of bytes in the stream
java.sql.SQLException
- if a database access error occurspublic void setUnicodeStreamAtName(java.lang.String paramName, java.io.InputStream stream, int length) throws java.sql.SQLException
setUnicodeStreamAtName
in interface OraclePreparedStatement
stream
- length
- paramName
-
java.sql.SQLException
- if a database access error occurspublic void setCustomDatum(int paramIndex, CustomDatum x) throws java.sql.SQLException
This method is deprecated. It is recommended to use setORAData().
setCustomDatum
in interface OraclePreparedStatement
x
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setCustomDatumAtName(java.lang.String paramName, CustomDatum x) throws java.sql.SQLException
setCustomDatumAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setORAData(int paramIndex, ORAData x) throws java.sql.SQLException
This is an Oracle specific method.
setORAData
in interface OraclePreparedStatement
x
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setORADataAtName(java.lang.String paramName, ORAData x) throws java.sql.SQLException
setORADataAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setObject(int paramIndex, java.lang.Object x, int targetSqlType, int scale) throws java.sql.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.
setObject
in interface java.sql.PreparedStatement
x
- the object containing the input parameter valuetargetSqlType
- 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.
java.sql.SQLException
- if a database access error occursTypes
public void setObjectAtName(java.lang.String paramName, java.lang.Object x, int targetSqlType, int scale) throws java.sql.SQLException
setObjectAtName
in interface OraclePreparedStatement
x
- the parameter valuetargetSqlType
- scale
- paramName
-
java.sql.SQLException
- if a database access error occurspublic void setObject(int paramIndex, java.lang.Object x, int targetSqlType) throws java.sql.SQLException
setObject
in interface java.sql.PreparedStatement
x
- the object containing the input parameter valuetargetSqlType
- the SQL type (as defined in java.sql.Types) to be
sent to the database
java.sql.SQLException
- if a database access error occurspublic void setObjectAtName(java.lang.String paramName, java.lang.Object x, int targetSqlType) throws java.sql.SQLException
setObjectAtName
in interface OraclePreparedStatement
x
- the parameter valuetargetSqlType
- paramName
-
java.sql.SQLException
- if a database access error occurspublic void setRefType(int paramIndex, REF ref) throws java.sql.SQLException
setRefType
in interface OraclePreparedStatement
ref
- the parameter value
java.sql.SQLException
- if a database access error occurssetREF
public void setRefTypeAtName(java.lang.String paramName, REF x) throws java.sql.SQLException
setRefTypeAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setRef(int paramIndex, java.sql.Ref ref) throws java.sql.SQLException
setRef
in interface java.sql.PreparedStatement
java.sql.SQLException
- if a database access error occurspublic void setRefAtName(java.lang.String paramName, java.sql.Ref x) throws java.sql.SQLException
setRefAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setREF(int paramIndex, REF ref) throws java.sql.SQLException
setREF
in interface OraclePreparedStatement
ref
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setREFAtName(java.lang.String paramName, REF x) throws java.sql.SQLException
setREFAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setObject(int paramIndex, java.lang.Object x) throws java.sql.SQLException
setObject
in interface java.sql.PreparedStatement
x
- the object containing the input parameter value
java.sql.SQLException
- if a database access error occurspublic void setObjectAtName(java.lang.String paramName, java.lang.Object x) throws java.sql.SQLException
setObjectAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setOracleObject(int paramIndex, Datum x) throws java.sql.SQLException
setOracleObject
in interface OraclePreparedStatement
x
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setOracleObjectAtName(java.lang.String paramName, Datum x) throws java.sql.SQLException
setOracleObjectAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic void setPlsqlIndexTable(int paramIndex, java.lang.Object arrayData, int maxLen, int curLen, int elemSqlType, int elemMaxLen) throws java.sql.SQLException
setPlsqlIndexTable
in interface OraclePreparedStatement
arrayData
- a java arraymaxLen
- the maximum possible number of elements.curLen
- the current number of elementselemSqlType
- index table element SQL type (as defined in
java.sql.Types or OracleTypes).elemMaxLen
- maximum length of the element. If not specified,
maximum length allowed for
that type is used.
java.sql.SQLException
- if a database access error occurspublic void setPlsqlIndexTableAtName(java.lang.String paramName, java.lang.Object arrayData, int maxLen, int curLen, int elemSqlType, int elemMaxLen) throws java.sql.SQLException
arrayData
- a java arraymaxLen
- the maximum possible number of elements.curLen
- the current number of elementselemSqlType
- index table element SQL type (as defined in
java.sql.Types or OracleTypes).elemMaxLen
- maximum length of the element. If not specified,
maximum length allowed for
that type is used.
java.sql.SQLException
- if a database access error occurspublic void clearParameters() throws java.sql.SQLException
In general, parameter values remain in force for repeated use of a Statement. Setting a parameter value automatically clears its previous value. However, in some cases it is useful to immediately release the resources used by the current parameter values; this can be done by calling clearParameters.
clearParameters
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setCharacterStream(int paramIndex, java.io.Reader reader, int length) throws java.sql.SQLException
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
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.
setCharacterStream
in interface java.sql.PreparedStatement
reader
- the java reader which contains the UNICODE datalength
- the number of characters in the stream
java.sql.SQLException
- if a database access error occurspublic void setDate(int paramIndex, java.sql.Date x, java.util.Calendar cal) throws java.sql.SQLException
Calendar
object. Since Oracle database
doesn't support timezone for DATE. This method set the same
value as setDate(idx, x).
setDate
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setTime(int paramIndex, java.sql.Time x, java.util.Calendar cal) throws java.sql.SQLException
Calendar
object. Since Oracle database
doesn't support timezone for DATE. This method set the same
value as setTime(idx, x).
setTime
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setTimestamp(int paramIndex, java.sql.Timestamp x, java.util.Calendar cal) throws java.sql.SQLException
Calendar
object. Since Oracle database
doesn't support timezone for DATE. This method set the same
value as setTimestamp(idx, x).
setTimestamp
in interface java.sql.PreparedStatement
java.sql.SQLException
public void addBatch() throws java.sql.SQLException
addBatch
in interface java.sql.PreparedStatement
java.sql.SQLException
- if an error occurred.public void addBatch(java.lang.String sql) throws java.sql.SQLException
addBatch
in interface java.sql.Statement
addBatch
in class OracleStatement
sql
- typically this is a static SQL INSERT or UPDATE
statement.
java.sql.SQLException
- if an error occurred.public void clearBatch() throws java.sql.SQLException
clearBatch
in interface java.sql.Statement
clearBatch
in class OracleStatement
java.sql.SQLException
- if a database access error occurred.
This can be used for clear both Jdbc & Oracle type batching.public int[] executeBatch() throws java.sql.SQLException
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.
executeBatch
in interface java.sql.Statement
executeBatch
in class OracleStatement
java.sql.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.)
java.sql.SQLException
public void setDisableStmtCaching(boolean cache)
setDisableStmtCaching
in interface OraclePreparedStatement
cache
- Set it to true, if you don't want this
statement to be cached.public void setFormOfUse(int paramIndex, short formOfUse)
setFormOfUse
in interface OraclePreparedStatement
paramIndex
- index of the column in the preparedStatmentformOfUse
- use FORM_CHAR for CHAR, VARCHAR2 and CLOB data,
or FORM_NCHAR for NCHAR, NVARCHAR2 and NCLOB data.
FORM_CHAR is the default.public void setURL(int paramIndex, java.net.URL x) throws java.sql.SQLException
java.net.URL
value.
The driver converts this to an SQL DATALINK
value
when it sends it to the database.
setURL
in interface java.sql.PreparedStatement
x
- the java.net.URL
object to be set
java.sql.SQLException
- if a database access error occurspublic void setURLAtName(java.lang.String paramName, java.net.URL x) throws java.sql.SQLException
setURLAtName
in interface OraclePreparedStatement
x
- the parameter valueparamName
-
java.sql.SQLException
- if a database access error occurspublic java.sql.ParameterMetaData getParameterMetaData() throws java.sql.SQLException
getParameterMetaData
in interface java.sql.PreparedStatement
java.sql.SQLException
public OracleParameterMetaData OracleGetParameterMetaData() throws java.sql.SQLException
oracle.jdbc.PreparedStatement
object's parameters.
OracleGetParameterMetaData
in interface OraclePreparedStatement
oracle.jdbc.OracleParameterMetaData
object
that contains information about the number, types and
properties of this PreparedStatement
object's parameters
java.sql.SQLException
- if a database access error occursOracleParameterMetaData
public java.sql.Connection getConnection() throws java.sql.SQLException
java.sql.SQLException
public void notify_close_rset() throws java.sql.SQLException
java.sql.SQLException
public java.lang.String getRevisedSql() throws java.sql.SQLException
java.sql.SQLException
public java.lang.String getOriginalSql() throws java.sql.SQLException
java.sql.SQLException
public oracle.jdbc.driver.OracleResultSetCache getResultSetCache() throws java.sql.SQLException
java.sql.SQLException
public void setAutoRefetch(boolean) throws java.sql.SQLException
java.sql.SQLException
public boolean getAutoRefetch() throws java.sql.SQLException
java.sql.SQLException
public int getMaxFieldSize() throws java.sql.SQLException
java.sql.SQLException
|
Oracle10g JDBC | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |