|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Oracle prepared statement class.
Fields inherited from class oracle.jdbc.OracleStatement |
EXPLICIT,
IMPLICIT,
NEW |
Method Summary |
Type | Method |
---|---|
void |
defineParameterType(int param_index,
int type,
int max_size)
Define the type under which you will bind the parameter and the maximum size of data you will bind in binds. |
int |
getExecuteBatch()
Retrieve the batch value (for Oracle-style batching only). |
int |
sendBatch()
Send any existing Oracle-style batch. |
void |
setARRAY(int paramIndex,
ARRAY arr)
Oracle specific. |
void |
setBfile(int paramIndex,
BFILE file)
Oracle specific. |
void |
setBFILE(int paramIndex,
BFILE file)
Oracle specific. |
void |
setBLOB(int paramIndex,
BLOB lob)
Oracle specific. |
void |
setCHAR(int paramIndex,
CHAR ch)
Oracle specific. |
void |
setCheckBindTypes(boolean flag)
Enable/disable bind type checking. |
void |
setCLOB(int paramIndex,
CLOB lob)
Oracle specific. |
void |
setCursor(int paramIndex,
java.sql.ResultSet rs)
Oracle specific. |
void |
setCustomDatum(int paramIndex,
CustomDatum x)
Deprecated. |
void |
setDATE(int paramIndex,
DATE date)
Oracle specific. |
void |
setDisableStmtCaching(boolean cache)
Don't Cache this object even when the corresponding Connection is Cache Enabled. |
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 |
setFormOfUse(int paramIndex,
short FormOfUse)
Allows to set the form of use if the form of use is set to Const.NCHAR the driver will treatthe data provided in the Server's National Character set. |
void |
setNUMBER(int paramIndex,
NUMBER num)
Oracle specific. |
void |
setOPAQUE(int paramIndex,
OPAQUE val)
Oracle specific. |
void |
setOracleObject(int paramIndex,
Datum x)
Oracle specific. |
void |
setORAData(int paramIndex,
ORAData x)
Oracle specific. |
void |
setPlsqlIndexTable(int paramIndex,
java.lang.Object arrayData,
int maxLen,
int curLen,
int elemSqlType,
int elemMaxLen)
Oracle OCI driver specific. |
void |
setRAW(int paramIndex,
RAW raw)
Oracle specific. |
void |
setREF(int paramIndex,
REF ref)
Oracle specific. |
void |
setRefType(int paramIndex,
REF ref)
Oracle specific. |
void |
setROWID(int paramIndex,
ROWID rowid)
Oracle specific. |
void |
setSTRUCT(int paramIndex,
STRUCT struct)
Oracle specific. |
void |
setTIMESTAMP(int paramIdx,
TIMESTAMP x)
Sets the designated parameter to an oracle.sql.TIMESTAMP value. |
void |
setTIMESTAMPLTZ(int paramIdx,
TIMESTAMPLTZ x)
Sets the designated parameter to an oracle.sql.TIMESTAMPLTZ value. |
void |
setTIMESTAMPTZ(int paramIdx,
TIMESTAMPTZ x)
Sets the designated parameter to an oracle.sql.TIMESTAMPTZ value. |
Methods inherited from interface java.sql.PreparedStatement |
addBatch,
clearParameters,
execute,
executeQuery,
executeUpdate,
getMetaData,
setArray,
setAsciiStream,
setBigDecimal,
setBinaryStream,
setBlob,
setBoolean,
setByte,
setBytes,
setCharacterStream,
setClob,
setDate,
setDate,
setDouble,
setFloat,
setInt,
setLong,
setNull,
setNull,
setObject,
setObject,
setObject,
setRef,
setShort,
setString,
setTime,
setTime,
setTimestamp,
setTimestamp,
setUnicodeStream |
Methods inherited from interface oracle.jdbc.OracleStatement |
clearDefines,
closeWithKey,
creationState,
defineColumnType,
defineColumnType,
defineColumnType,
defineColumnTypeChars,
getRowPrefetch,
setResultSetCache,
setRowPrefetch |
Method Detail |
public void defineParameterType(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 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.
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.public int getExecuteBatch()
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
oracle.jdbc.driver.OraclePreparedStatement
.
public void setARRAY(int paramIndex, ARRAY arr) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuepublic void setBfile(int paramIndex, BFILE file) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuepublic void setBFILE(int paramIndex, BFILE file) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuepublic void setBLOB(int paramIndex, BLOB lob) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuepublic void setCHAR(int paramIndex, CHAR ch) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuepublic void setCLOB(int paramIndex, CLOB lob) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuepublic void setCursor(int paramIndex, java.sql.ResultSet rs) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuepublic void setCustomDatum(int paramIndex, CustomDatum x) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuepublic void setORAData(int paramIndex, ORAData x) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuepublic void setDATE(int paramIndex, DATE date) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuepublic 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
oracle.jdbc.driver.OraclePreparedStatement
.
batchValue
- batch value to be set. It must be greater than or
equal to 1.public void setFixedCHAR(int paramIndex, java.lang.String x) throws java.sql.SQLException
paramIndex
- index of the bind variablex
- the literal/variable to be bound.public void setNUMBER(int paramIndex, NUMBER num) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuepublic void setOPAQUE(int paramIndex, OPAQUE val) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuepublic void setOracleObject(int paramIndex, Datum x) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuepublic void setRAW(int paramIndex, RAW raw) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuepublic void setREF(int paramIndex, REF ref) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuepublic void setRefType(int paramIndex, REF ref) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuepublic void setROWID(int paramIndex, ROWID rowid) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuepublic void setSTRUCT(int paramIndex, STRUCT struct) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuepublic void setTIMESTAMP(int paramIdx, TIMESTAMP x) throws java.sql.SQLException
paramIdx
- specifies the parameter index. Index starts from 1.x
- specifies the parameter value.public void setTIMESTAMPTZ(int paramIdx, TIMESTAMPTZ x) throws java.sql.SQLException
paramIdx
- specifies the parameter index. Index starts from 1.x
- specifies the parameter value.public void setTIMESTAMPLTZ(int paramIdx, TIMESTAMPLTZ x) throws java.sql.SQLException
In order to use this method, the calling program must first set the session time zone of the corresponding connection by using OracleConnection.setSessionTimeZone().
paramIdx
- specifies the parameter index. Index starts from 1.x
- specifies the parameter value.public void setCheckBindTypes(boolean flag)
When bind type checking is disabled, the Jdbc driver does not check bind types for every execute. It is intended to be used as a performance enhancement if the user knows for fact that bind types do not change across different executions. The default is true.
flag
- Set it to false if Bind Types doesn't changepublic void setPlsqlIndexTable(int paramIndex, java.lang.Object arrayData, int maxLen, int curLen, int elemSqlType, int elemMaxLen) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...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.public void setFormOfUse(int paramIndex, short FormOfUse)
if the form of use is set to Const.NCHAR the driver will treatthe data provided in the Server's National Character set. default is Const.CHAR
paramIndex
- the index of the column in the preparedStatment
FormOfUse
can have only two values Const.CHAR and Const.NCHAR
which describe respectively regular and NCHAR modepublic void setDisableStmtCaching(boolean cache)
cache
- Set it to true, if you don't want this
statement to be cached.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |