|
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.jdbc.driver.OracleCallableStatement
Oracle callable statement.
Field Summary | |
static java.lang.String |
BUILD_DATE
|
static boolean |
PRIVATE_TRACE
|
static boolean |
TRACE
|
Fields inherited from class oracle.jdbc.driver.OraclePreparedStatement |
TypeBinder_BYTELEN |
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.OraclePreparedStatement |
FORM_CHAR, FORM_NCHAR |
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 |
clearParameters()
In general, parameter values remain in force for repeated use of a Statement. |
boolean |
execute()
Execute the statement. |
int |
executeUpdate()
Execute the update statement. |
java.lang.Object |
getAnyDataEmbeddedObject(int parameterIndex)
Retrieves data of an embedded object within AnyData |
java.sql.Array |
getArray(int parameterIndex)
|
ARRAY |
getARRAY(int parameterIndex)
Retrieves data into an oracle.sql.ARRAY object. |
java.sql.Array |
getArray(java.lang.String parameterName)
JDBC 3.0 Retrieves the value of a JDBC ARRAY parameter as an
Array object in the Java programming language. |
java.io.InputStream |
getAsciiStream(int parameterIndex)
Retrieves data into an java.io.InputStream object. |
BFILE |
getBFILE(int parameterIndex)
Retrieves data into an oracle.sql.BFILE object. |
java.math.BigDecimal |
getBigDecimal(int parameterIndex)
|
java.math.BigDecimal |
getBigDecimal(int parameterIndex,
int scale)
|
java.math.BigDecimal |
getBigDecimal(java.lang.String parameterName)
JDBC 3.0 Retrieves the value of a JDBC NUMERIC parameter as a
java.math.BigDecimal object with as many digits to the
right of the decimal point as the value contains. |
java.io.InputStream |
getBinaryStream(int parameterIndex)
Retrieves data into an java.io.InputStream object. |
java.sql.Blob |
getBlob(int parameterIndex)
|
BLOB |
getBLOB(int parameterIndex)
Retrieves data into an oracle.sql.BLOB object. |
java.sql.Blob |
getBlob(java.lang.String parameterName)
JDBC 3.0 Retrieves the value of a JDBC BLOB parameter as a
Blob object in the Java programming language. |
boolean |
getBoolean(int parameterIndex)
|
boolean |
getBoolean(java.lang.String parameterName)
JDBC 3.0 Retrieves the value of a JDBC BIT parameter as a
boolean in the Java programming language. |
byte |
getByte(int parameterIndex)
|
byte |
getByte(java.lang.String parameterName)
JDBC 3.0 Retrieves the value of a JDBC TINYINT parameter as a byte
in the Java programming language. |
byte[] |
getBytes(int parameterIndex)
|
byte[] |
getBytes(java.lang.String parameterName)
JDBC 3.0 Retrieves the value of a JDBC BINARY or VARBINARY
parameter as an array of byte values in the Java
programming language. |
CHAR |
getCHAR(int parameterIndex)
Retrieves data into an oracle.sql.CHAR object. |
java.io.Reader |
getCharacterStream(int parameterIndex)
Retrieves data into an java.io.Reader object. |
java.sql.Clob |
getClob(int parameterIndex)
|
CLOB |
getCLOB(int parameterIndex)
Retrieves data into an oracle.sql.CLOB object. |
java.sql.Clob |
getClob(java.lang.String parameterName)
JDBC 3.0 Retrieves the value of a JDBC CLOB parameter as a
Clob object in the Java programming language. |
java.sql.ResultSet |
getCursor(int parameterIndex)
Retrieves data into an java.sql.ResultSet object. |
java.lang.Object |
getCustomDatum(int parameterIndex,
CustomDatumFactory factory)
|
java.sql.Date |
getDate(int parameterIndex)
|
DATE |
getDATE(int parameterIndex)
Retrieves data into an oracle.sql.DATE object. |
java.sql.Date |
getDate(int parameterIndex,
java.util.Calendar cal)
|
java.sql.Date |
getDate(java.lang.String parameterName)
JDBC 3.0 Retrieves the value of a JDBC DATE parameter as a
java.sql.Date object. |
java.sql.Date |
getDate(java.lang.String parameterName,
java.util.Calendar cal)
JDBC 3.0 Retrieves the value of a JDBC DATE parameter as a
java.sql.Date object, using
the given Calendar object
to construct the date. |
double |
getDouble(int parameterIndex)
|
double |
getDouble(java.lang.String parameterName)
JDBC 3.0 Retrieves the value of a JDBC DOUBLE parameter as a double
in the Java programming language. |
float |
getFloat(int parameterIndex)
|
float |
getFloat(java.lang.String parameterName)
JDBC 3.0 Retrieves the value of a JDBC FLOAT parameter as a float
in the Java programming language. |
int |
getInt(int parameterIndex)
|
int |
getInt(java.lang.String parameterName)
JDBC 3.0 Retrieves the value of a JDBC INTEGER parameter as an int
in the Java programming language. |
INTERVALDS |
getINTERVALDS(int parameterIndex)
Retrieves data into an oracle.sql.INTERVALDS object. |
INTERVALYM |
getINTERVALYM(int parameterIndex)
Retrieves data into an oracle.sql.INTERVALYM object. |
long |
getLong(int parameterIndex)
|
long |
getLong(java.lang.String parameterName)
JDBC 3.0 Retrieves the value of a JDBC BIGINT parameter as a long
in the Java programming language. |
NUMBER |
getNUMBER(int parameterIndex)
Retrieves data into an oracle.sql.NUMBER object. |
java.lang.Object |
getObject(int parameterIndex)
|
java.lang.Object |
getObject(int parameterIndex,
java.util.Map map)
|
java.lang.Object |
getObject(java.lang.String parameterName)
JDBC 3.0 Retrieves the value of a parameter as an Object in the Java
programming language. |
java.lang.Object |
getObject(java.lang.String parameterName,
java.util.Map map)
JDBC 3.0 Returns an object representing the value of OUT parameter i and uses map for the custom
mapping of the parameter value. |
OPAQUE |
getOPAQUE(int parameterIndex)
Retrieves data into an oracle.sql.OPAQUE object. |
Datum |
getOracleObject(int parameterIndex)
Retrieves data into an oracle.sql.Datum object. |
Datum[] |
getOraclePlsqlIndexTable(int parameterIndex)
Oracle OCI driver specific. |
java.lang.Object |
getORAData(int parameterIndex,
ORADataFactory factory)
|
java.lang.Object |
getPlsqlIndexTable(int paramIndex)
Oracle OCI driver specific. |
java.lang.Object |
getPlsqlIndexTable(int paramIndex,
java.lang.Class primitiveType)
Oracle OCI driver specific. |
RAW |
getRAW(int parameterIndex)
Retrieves data into an oracle.sql.RAW object. |
java.sql.Ref |
getRef(int parameterIndex)
|
REF |
getREF(int parameterIndex)
Retrieves data into an oracle.sql.REF object. |
java.sql.Ref |
getRef(java.lang.String parameterName)
JDBC 3.0 Retrieves the value of a JDBC REF(<structured-type>)
parameter as a Ref object in the Java programming language. |
ROWID |
getROWID(int parameterIndex)
Retrieves data into an oracle.sql.ROWID object. |
short |
getShort(int parameterIndex)
|
short |
getShort(java.lang.String parameterName)
JDBC 3.0 Retrieves the value of a JDBC SMALLINT parameter as a short
in the Java programming language. |
java.lang.String |
getString(int parameterIndex)
|
java.lang.String |
getString(java.lang.String parameterName)
JDBC 3.0 Retrieves the value of a JDBC CHAR , VARCHAR ,
or LONGVARCHAR parameter as a String in
the Java programming language. |
STRUCT |
getSTRUCT(int parameterIndex)
Retrieves data into an oracle.sql.STRUCT object. |
java.sql.Time |
getTime(int parameterIndex)
|
java.sql.Time |
getTime(int parameterIndex,
java.util.Calendar cal)
|
java.sql.Time |
getTime(java.lang.String parameterName)
JDBC 3.0 Retrieves the value of a JDBC TIME parameter as a
java.sql.Time object. |
java.sql.Time |
getTime(java.lang.String parameterName,
java.util.Calendar cal)
JDBC 3.0 Retrieves the value of a JDBC TIME parameter as a
java.sql.Time object, using
the given Calendar object
to construct the time. |
java.sql.Timestamp |
getTimestamp(int parameterIndex)
|
TIMESTAMP |
getTIMESTAMP(int parameterIndex)
Retrieves data into an oracle.sql.TIMESTAMP object. |
java.sql.Timestamp |
getTimestamp(int parameterIndex,
java.util.Calendar cal)
|
java.sql.Timestamp |
getTimestamp(java.lang.String parameterName)
JDBC 3.0 Retrieves the value of a JDBC TIMESTAMP parameter as a
java.sql.Timestamp object. |
java.sql.Timestamp |
getTimestamp(java.lang.String parameterName,
java.util.Calendar cal)
JDBC 3.0 Retrieves the value of a JDBC TIMESTAMP parameter as a
java.sql.Timestamp object, using
the given Calendar object to construct
the Timestamp object. |
TIMESTAMPLTZ |
getTIMESTAMPLTZ(int parameterIndex)
Retrieves data into an oracle.sql.TIMESTAMPLTZ object. |
TIMESTAMPTZ |
getTIMESTAMPTZ(int parameterIndex)
Retrieves data into an oracle.sql.TIMESTAMPTZ object. |
java.io.InputStream |
getUnicodeStream(int parameterIndex)
Retrieves data into an java.io.InputStream object. |
java.net.URL |
getURL(int parameterIndex)
JDBC 3.0 Retrieves the value of the designated JDBC DATALINK parameter as a
java.net.URL object. |
java.net.URL |
getURL(java.lang.String parameterName)
JDBC 3.0 Retrieves the value of a JDBC DATALINK parameter as a
java.net.URL object. |
void |
registerIndexTableOutParameter(int paramIndex,
int maxLen,
int elemSqlType,
int elemMaxLen)
Oracle OCI driver specific. |
void |
registerOutParameter(int paramIndex,
int sqlType)
|
void |
registerOutParameter(int paramIndex,
int sqlType,
int scale)
|
void |
registerOutParameter(int paramIndex,
int sqlType,
int scale,
int maxLength)
Special Oracle version of registerOutParameter for registering CHAR, VARCHAR, LONG, RAW and LONG RAW columns. |
void |
registerOutParameter(int paramIndex,
int sqlType,
java.lang.String sqlName)
Special Oracle version of registerOutParameter for registering Object columns. |
void |
registerOutParameter(java.lang.String parameterName,
int sqlType)
JDBC 3.0 Registers the OUT parameter named parameterName to the JDBC type
sqlType . |
void |
registerOutParameter(java.lang.String parameterName,
int sqlType,
int scale)
JDBC 3.0 Registers the parameter named parameterName to be of JDBC type
sqlType . |
void |
registerOutParameter(java.lang.String parameterName,
int sqlType,
int scale,
int maxLength)
Special Oracle version of registerOutParameter for registering CHAR, VARCHAR, LONG, RAW and LONG RAW columns. |
void |
registerOutParameter(java.lang.String parameterName,
int sqlType,
java.lang.String typeName)
JDBC 3.0 Registers the designated output parameter. |
void |
registerOutParameterBytes(int paramIndex,
int sqlType,
int scale,
int maxLength)
Special Oracle version of registerOutParameter for registering CHAR, VARCHAR, LONG, RAW and LONG RAW columns. |
void |
registerOutParameterChars(int paramIndex,
int sqlType,
int scale,
int maxLength)
Special Oracle version of registerOutParameter for registering CHAR, VARCHAR, LONG, RAW and LONG RAW columns. |
int |
sendBatch()
Send the sets of parameters batched (for Oracle-style batching only). |
void |
setArray(int paramIndex,
java.sql.Array x)
JDBC 2.0. |
void |
setARRAY(int paramIndex,
ARRAY x)
Binds the designated parameter to a oracle.sql.ARRAY . |
void |
setAsciiStream(int paramIndex,
java.io.InputStream x,
int y)
Sets the designated parameter to the given input stream, which will have the specified number of bytes. |
void |
setAsciiStream(java.lang.String parameterName,
java.io.InputStream x,
int length)
JDBC 3.0 Sets the designated parameter to the given input stream, which will have the specified number of bytes. |
void |
setBfile(int paramIndex,
BFILE x)
Binds the designated parameter to a oracle.sql.BFILE value. |
void |
setBFILE(int paramIndex,
BFILE x)
Binds the designated parameter to a oracle.sql.BFILE value. |
void |
setBigDecimal(int paramIndex,
java.math.BigDecimal x)
Sets the designated parameter to a java.math.BigDecimal value. |
void |
setBigDecimal(java.lang.String parameterName,
java.math.BigDecimal x)
JDBC 3.0 Sets the designated parameter to the given java.math.BigDecimal value. |
void |
setBinaryDouble(int paramIndex,
BINARY_DOUBLE x)
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 |
setBinaryDouble(java.lang.String parameterName,
BINARY_DOUBLE x)
Sets the designated parameter to the given oracle.sql.BINARY_FLOAT value. |
void |
setBinaryDouble(java.lang.String parameterName,
double x)
Sets the designated parameter to the given Java double value. |
void |
setBinaryFloat(int paramIndex,
BINARY_FLOAT x)
Sets the designated parameter to an oracle.sql.BINARY_FLOAT value. |
void |
setBinaryFloat(int paramIndex,
float x)
Sets the designated parameter to a Java Float value. |
void |
setBinaryFloat(java.lang.String parameterName,
BINARY_FLOAT x)
Sets the designated parameter to the given oracle.sql.BINARY_FLOAT value. |
void |
setBinaryFloat(java.lang.String parameterName,
float x)
Sets the designated parameter to the given Java float value. |
void |
setBinaryStream(int paramIndex,
java.io.InputStream x,
int y)
Sets the designated parameter to the given input stream, which will have the specified number of bytes. |
void |
setBinaryStream(java.lang.String parameterName,
java.io.InputStream x,
int length)
JDBC 3.0 Sets the designated parameter to the given input stream, which will have the specified number of bytes. |
void |
setBlob(int paramIndex,
java.sql.Blob x)
JDBC 2.0. |
void |
setBLOB(int paramIndex,
BLOB x)
Binds the designated parameter to a oracle.sql.BLOB value. |
void |
setBoolean(int paramIndex,
boolean x)
Sets the designated parameter to a Java boolean value. |
void |
setBoolean(java.lang.String parameterName,
boolean x)
JDBC 3.0 Sets the designated parameter to the given Java boolean value. |
void |
setByte(int paramIndex,
byte x)
Sets the designated parameter to a Java byte value. |
void |
setByte(java.lang.String parameterName,
byte x)
JDBC 3.0 Sets the designated parameter to the given Java byte value. |
void |
setBytes(int paramIndex,
byte[] x)
Sets the designated parameter to a Java array of bytes. |
void |
setBytes(java.lang.String parameterName,
byte[] x)
JDBC 3.0 Sets the designated parameter to the given Java array of bytes. |
void |
setCHAR(int paramIndex,
CHAR x)
Binds the designated parameter to a oracle.sql.CHAR value. |
void |
setCharacterStream(int paramIndex,
java.io.Reader x,
int y)
JDBC 2.0 Sets the designated parameter to the given Reader
object, which is the given number of characters long. |
void |
setCharacterStream(java.lang.String parameterName,
java.io.Reader reader,
int length)
JDBC 3.0 Sets the designated parameter to the given Reader
object, which is the given number of characters long. |
void |
setClob(int paramIndex,
java.sql.Clob x)
JDBC 2.0. |
void |
setCLOB(int paramIndex,
CLOB x)
Binds the designated parameter to a oracle.sql.CLOB value. |
void |
setCursor(int paramIndex,
java.sql.ResultSet x)
Binds the designated parameter to a java.sql.ResultSet . |
void |
setCustomDatum(int paramIndex,
CustomDatum x)
Binds the designated parameter to a oracle.sql.CustomDatum
value. |
void |
setDate(int paramIndex,
java.sql.Date x)
Sets the designated parameter to a java.sql.Date value. |
void |
setDATE(int paramIndex,
DATE x)
Binds the designated parameter to a oracle.sql.DATE value. |
void |
setDate(int paramIndex,
java.sql.Date x,
java.util.Calendar y)
JDBC 2.0 Sets the designated parameter to a java.sql.Date value, using the given Calendar object. |
void |
setDate(java.lang.String parameterName,
java.sql.Date x)
JDBC 3.0 Sets the designated parameter to the given java.sql.Date value. |
void |
setDate(java.lang.String parameterName,
java.sql.Date x,
java.util.Calendar cal)
JDBC 3.0 Sets the designated parameter to the given java.sql.Date value,
using the given Calendar object. |
void |
setDouble(int paramIndex,
double x)
Sets the designated parameter to a Java double value. |
void |
setDouble(java.lang.String parameterName,
double x)
JDBC 3.0 Sets the designated parameter to the given Java double value. |
void |
setExecuteBatch(int nrows)
Set the batch value (for Oracle-style batching only). |
void |
setFixedCHAR(int paramIndex,
java.lang.String x)
Sets the disignated parameter to a String and executes a
non-padded comparison with a SQL CHAR. |
void |
setFloat(int paramIndex,
float x)
Sets the designated parameter to a Java float value. |
void |
setFloat(java.lang.String parameterName,
float x)
JDBC 3.0 Sets the designated parameter to the given Java float value. |
void |
setInt(int paramIndex,
int x)
Sets the designated parameter to a Java int value. |
void |
setInt(java.lang.String parameterName,
int x)
JDBC 3.0 Sets the designated parameter to the given Java int value. |
void |
setInternalBytes(int paramIndex,
byte[] x,
int y)
|
void |
setINTERVALDS(int paramIndex,
INTERVALDS x)
Binds the designated parameter to an oracle.sql.INTERVALDS value. |
void |
setINTERVALYM(int paramIndex,
INTERVALYM x)
Binds the designated parameter to an oracle.sql.INTERVALYM value. |
void |
setLong(int paramIndex,
long x)
Sets the designated parameter to a Java long value. |
void |
setLong(java.lang.String parameterName,
long x)
JDBC 3.0 Sets the designated parameter to the given Java long value. |
void |
setNull(int paramIndex,
int x)
Sets the designated parameter to SQL NULL. |
void |
setNull(int paramIndex,
int x,
java.lang.String y)
Implements JDBC 2.0 setNull for object types. |
void |
setNull(java.lang.String parameterName,
int sqlType)
JDBC 3.0 Sets the designated parameter to SQL NULL . |
void |
setNull(java.lang.String parameterName,
int sqlType,
java.lang.String typeName)
JDBC 3.0 Sets the designated parameter to SQL NULL . |
void |
setNUMBER(int paramIndex,
NUMBER x)
Binds the designated parameter to a oracle.sql.NUMBER value. |
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 y)
Sets the value of the designated parameter with the given object. |
void |
setObject(int paramIndex,
java.lang.Object x,
int y,
int z)
Sets the value of a parameter using an object. |
void |
setObject(java.lang.String parameterName,
java.lang.Object x)
JDBC 3.0 Sets the value of the designated parameter with the given object. |
void |
setObject(java.lang.String parameterName,
java.lang.Object x,
int targetSqlType)
JDBC 3.0 Sets the value of the designated parameter with the given object. |
void |
setObject(java.lang.String parameterName,
java.lang.Object x,
int targetSqlType,
int scale)
JDBC 3.0 Sets the value of the designated parameter with the given object. |
void |
setOPAQUE(int paramIndex,
OPAQUE x)
Binds the designated parameter to a oracle.sql.OPAQUE value. |
void |
setOracleObject(int paramIndex,
Datum x)
Binds the designated parameter to a oracle.sql.Datum value. |
void |
setORAData(int paramIndex,
ORAData x)
Binds the designated parameter to a oracle.sql.ORAData value. |
void |
setPlsqlIndexTable(int paramIndex,
java.lang.Object arrayData,
int maxLen,
int curLen,
int elemSqlType,
int elemMaxLen)
Binds a PL/SQL index-by table parameter in the IN parameter mode. |
void |
setRAW(int paramIndex,
RAW x)
Binds the designated parameter to a oracle.sql.RAW value. |
void |
setRef(int paramIndex,
java.sql.Ref x)
JDBC 2.0 Sets a Ref(<structured-type>) parameter. |
void |
setREF(int paramIndex,
REF x)
Binds the designated parameter to a oracle.sql.REF value. |
void |
setRefType(int paramIndex,
REF x)
Binds the designated parameter to a oracle.sql.REF value. |
void |
setROWID(int paramIndex,
ROWID x)
Binds the designated parameter to a oracle.sql.ROWID value. |
void |
setShort(int paramIndex,
short x)
Sets the designated parameter to a Java short value. |
void |
setShort(java.lang.String parameterName,
short x)
JDBC 3.0 Sets the designated parameter to the given Java short value. |
void |
setString(int paramIndex,
java.lang.String x)
Sets the designated parameter to a Java String value. |
void |
setString(java.lang.String parameterName,
java.lang.String x)
JDBC 3.0 Sets the designated parameter to the given Java String value. |
void |
setStringForClob(java.lang.String parameterName,
java.lang.String x)
Sets the designated parameter to the given Java String value. |
void |
setSTRUCT(int paramIndex,
STRUCT x)
Binds the designated parameter to a oracle.sql.STRUCT value. |
void |
setStructDescriptor(int paramIndex,
StructDescriptor x)
Binds the bind type of 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 y)
JDBC 2.0 Sets the designated parameter to a java.sql.Time value, using the given Calendar object. |
void |
setTime(java.lang.String parameterName,
java.sql.Time x)
JDBC 3.0 Sets the designated parameter to the given java.sql.Time value. |
void |
setTime(java.lang.String parameterName,
java.sql.Time x,
java.util.Calendar cal)
JDBC 3.0 Sets the designated parameter to the given java.sql.Time value,
using the given Calendar object. |
void |
setTimestamp(int paramIndex,
java.sql.Timestamp x)
Sets the designated parameter to a java.sql.Timestamp value. |
void |
setTIMESTAMP(int paramIndex,
TIMESTAMP x)
Binds the designated parameter to an oracle.sql.TIMESTAMP value. |
void |
setTimestamp(int paramIndex,
java.sql.Timestamp x,
java.util.Calendar y)
JDBC 2.0 Sets the designated parameter to a java.sql.Timestamp value, using the given Calendar object. |
void |
setTimestamp(java.lang.String parameterName,
java.sql.Timestamp x)
JDBC 3.0 Sets the designated parameter to the given java.sql.Timestamp value. |
void |
setTimestamp(java.lang.String parameterName,
java.sql.Timestamp x,
java.util.Calendar cal)
JDBC 3.0 Sets the designated parameter to the given java.sql.Timestamp value,
using the given Calendar object. |
void |
setTIMESTAMPLTZ(int paramIndex,
TIMESTAMPLTZ x)
Binds the designated parameter to an oracle.sql.TIMESTAMPLTZ
value. |
void |
setTIMESTAMPTZ(int paramIndex,
TIMESTAMPTZ x)
Binds the designated parameter to an oracle.sql.TIMESTAMPTZ value. |
void |
setUnicodeStream(int paramIndex,
java.io.InputStream x,
int y)
Sets the designated parameter to the given input stream, which will have the specified number of bytes. |
void |
setURL(int paramIndex,
java.net.URL x)
JDBC 3.0 Sets the designated parameter to the given java.net.URL value. |
void |
setURL(java.lang.String parameterName,
java.net.URL val)
JDBC 3.0 Sets the designated parameter to the given java.net.URL object. |
boolean |
wasNull()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.sql.PreparedStatement |
executeQuery, getMetaData, getParameterMetaData |
Methods inherited from interface java.sql.Statement |
addBatch, cancel, clearBatch, clearWarnings, close, execute, execute, execute, execute, executeBatch, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setQueryTimeout |
Methods inherited from interface oracle.jdbc.OracleStatement |
clearDefines, closeWithKey, creationState, defineColumnType, defineColumnType, defineColumnType, defineColumnType, defineColumnTypeBytes, defineColumnTypeChars, getRowPrefetch, isNCHAR, setResultSetCache, setRowPrefetch |
Methods inherited from interface oracle.jdbc.internal.OraclePreparedStatement |
enterExplicitCache, enterImplicitCache, exitExplicitCacheToActive, exitExplicitCacheToClose, exitImplicitCacheToActive, exitImplicitCacheToClose, setCheckBindTypes |
Methods inherited from interface oracle.jdbc.internal.OracleStatement |
getcacheState, getFixedString, getserverCursor, getstatementType, setFixedString |
Field Detail |
public static final boolean TRACE
public static final boolean PRIVATE_TRACE
public static final java.lang.String BUILD_DATE
Method Detail |
public void registerOutParameter(int paramIndex, int sqlType, java.lang.String sqlName) throws java.sql.SQLException
registerOutParameter
in interface java.sql.CallableStatement
paramIndex
- parameter index.sqlType
- use OracleTypes.STRUCT, OracleTypes.ARRAY,
OracleTypes.REF, or OracleTypes.OPAQUE.sqlName
- SQL name of the object.
java.sql.SQLException
- if sqlType is invalid, or an error occurred.public void registerOutParameterBytes(int paramIndex, int sqlType, int scale, int maxLength) throws java.sql.SQLException
registerOutParameterBytes
in interface OracleCallableStatement
paramIndex
- parameter index (the first parameter is 1).sqlType
- type of the bind parameterscale
- not usedmaxLength
- maximum length of the column, specified in bytes. If not
specified, maximum length allowed for that type is used.
java.sql.SQLException
- if an error occurs (conversion or database-access
error)public void registerOutParameterChars(int paramIndex, int sqlType, int scale, int maxLength) throws java.sql.SQLException
registerOutParameterChars
in interface OracleCallableStatement
paramIndex
- parameter index (the first parameter is 1).sqlType
- type of the bind parameterscale
- not usedmaxLength
- maximum length of the column, specified in characters. If not
specified, maximum length allowed for that type is used.
java.sql.SQLException
- if an error occurs (conversion or database-access
error)public void registerOutParameter(int paramIndex, int sqlType, int scale, int maxLength) throws java.sql.SQLException
registerOutParameter
in interface OracleCallableStatement
paramIndex
- parameter index (the first parameter is 1).sqlType
- type of the bind parameterscale
- not usedmaxLength
- maximum length of the column, specified in bytes or characters.
java.sql.SQLException
- if an error occurs (conversion or database-access
error)public void registerOutParameter(java.lang.String parameterName, int sqlType, int scale, int maxLength) throws java.sql.SQLException
registerOutParameter
in interface OracleCallableStatement
parameterName
- the name of the parametersqlType
- SQL type code defined by java.sql.Types
.scale
- the desired number of digits to the right of the
decimal point. It must be greater than or equal to zero.maxLength
- maximum length of the column, specified in bytes or characters.
java.sql.SQLException
- if an error occurs (conversion or database-access
error)public void setExecuteBatch(int nrows) throws java.sql.SQLException
Oracle-style batching is not supported for a callable statement. This method always sets the batch value to 1.
setExecuteBatch
in interface OracleCallableStatement
setExecuteBatch
in class OraclePreparedStatement
nrows
- batch value to be set. It must be greater than or
equal to 1.
java.sql.SQLException
public int sendBatch() throws java.sql.SQLException
Oracle-style batching is not supported for a callable statement. This method simply returns the number of valid rows.
sendBatch
in interface OracleCallableStatement
sendBatch
in class OraclePreparedStatement
java.sql.SQLException
- if an error occurred.public void registerOutParameter(int paramIndex, int sqlType) throws java.sql.SQLException
registerOutParameter
in interface java.sql.CallableStatement
java.sql.SQLException
public void registerOutParameter(int paramIndex, int sqlType, int scale) throws java.sql.SQLException
registerOutParameter
in interface java.sql.CallableStatement
java.sql.SQLException
public boolean wasNull() throws java.sql.SQLException
wasNull
in interface java.sql.CallableStatement
java.sql.SQLException
public java.lang.String getString(int parameterIndex) throws java.sql.SQLException
getString
in interface java.sql.CallableStatement
java.sql.SQLException
public Datum getOracleObject(int parameterIndex) throws java.sql.SQLException
OracleCallableStatement
oracle.sql.Datum
object.
getOracleObject
in interface OracleCallableStatement
parameterIndex
- the first parameter is 1, the second is 2, and so on
oracle.sql.Datum
java.sql.SQLException
- if an error occurs (conversion or database-access error)public ROWID getROWID(int parameterIndex) throws java.sql.SQLException
OracleCallableStatement
oracle.sql.ROWID
object.
getROWID
in interface OracleCallableStatement
parameterIndex
- the first parameter is 1, the second is 2, and so on
oracle.sql.ROWID
java.sql.SQLException
- if an error occurs (conversion or database-access error)public NUMBER getNUMBER(int parameterIndex) throws java.sql.SQLException
OracleCallableStatement
oracle.sql.NUMBER
object.
getNUMBER
in interface OracleCallableStatement
parameterIndex
- the first parameter is 1, the second is 2, and so on
oracle.sql.NUMBER
java.sql.SQLException
- if an error occurs (conversion or database-access error)public DATE getDATE(int parameterIndex) throws java.sql.SQLException
OracleCallableStatement
oracle.sql.DATE
object.
getDATE
in interface OracleCallableStatement
parameterIndex
- the first parameter is 1, the second is 2, and so on
oracle.sql.DATE
java.sql.SQLException
- if an error occurs (conversion or database-access error)public INTERVALYM getINTERVALYM(int parameterIndex) throws java.sql.SQLException
OracleCallableStatement
oracle.sql.INTERVALYM
object.
getINTERVALYM
in interface OracleCallableStatement
parameterIndex
- the first parameter is 1, the second is 2, and so on
oracle.sql.INTERVALYM
java.sql.SQLException
- if an error occurs (conversion or
database-access error)public INTERVALDS getINTERVALDS(int parameterIndex) throws java.sql.SQLException
OracleCallableStatement
oracle.sql.INTERVALDS
object.
getINTERVALDS
in interface OracleCallableStatement
parameterIndex
- the first parameter is 1, the second is 2, and so on
oracle.sql.INTERVALDS
java.sql.SQLException
- if an error occurs (conversion or
database-access error)public TIMESTAMP getTIMESTAMP(int parameterIndex) throws java.sql.SQLException
OracleCallableStatement
oracle.sql.TIMESTAMP
object.
getTIMESTAMP
in interface OracleCallableStatement
parameterIndex
- the first parameter is 1, the second is 2, and so on
oracle.sql.TIMESTAMP
java.sql.SQLException
- if an error occurs (conversion or database-access error)public TIMESTAMPTZ getTIMESTAMPTZ(int parameterIndex) throws java.sql.SQLException
OracleCallableStatement
oracle.sql.TIMESTAMPTZ
object.
getTIMESTAMPTZ
in interface OracleCallableStatement
parameterIndex
- the first parameter is 1, the second is 2, and so on
oracle.sql.TIMESTAMPTZ
java.sql.SQLException
- if an error occurs (conversion or database-access error)public TIMESTAMPLTZ getTIMESTAMPLTZ(int parameterIndex) throws java.sql.SQLException
OracleCallableStatement
oracle.sql.TIMESTAMPLTZ
object.
getTIMESTAMPLTZ
in interface OracleCallableStatement
parameterIndex
- the first parameter is 1, the second is 2, and so on
oracle.sql.TIMESTAMPLTZ
java.sql.SQLException
- if an error occurs (conversion or database-access error)public REF getREF(int parameterIndex) throws java.sql.SQLException
OracleCallableStatement
oracle.sql.REF
object.
getREF
in interface OracleCallableStatement
parameterIndex
- the first parameter is 1, the second is 2, and so on
oracle.sql.REF
java.sql.SQLException
- if an error occurs (conversion or database-access error)public ARRAY getARRAY(int parameterIndex) throws java.sql.SQLException
OracleCallableStatement
oracle.sql.ARRAY
object.
getARRAY
in interface OracleCallableStatement
parameterIndex
- the first parameter is 1, the second is 2, and so on
ARRAY
java.sql.SQLException
- if an error occurs (conversion or database-access error)public STRUCT getSTRUCT(int parameterIndex) throws java.sql.SQLException
OracleCallableStatement
oracle.sql.STRUCT
object.
getSTRUCT
in interface OracleCallableStatement
parameterIndex
- the first parameter is 1, the second is 2, and so on
oracle.sql.STRUCT
java.sql.SQLException
- if an error occurs (conversion or database-access error)public OPAQUE getOPAQUE(int parameterIndex) throws java.sql.SQLException
OracleCallableStatement
oracle.sql.OPAQUE
object.
getOPAQUE
in interface OracleCallableStatement
parameterIndex
- the first parameter is 1, the second is 2, and so on
oracle.sql.OPAQUE
java.sql.SQLException
- if an error occurs (conversion or database-access error)public CHAR getCHAR(int parameterIndex) throws java.sql.SQLException
OracleCallableStatement
oracle.sql.CHAR
object.
getCHAR
in interface OracleCallableStatement
parameterIndex
- the first parameter is 1, the second is 2, and so on
oracle.sql.CHAR
java.sql.SQLException
- if an error occurs (conversion or database-access error)public java.io.Reader getCharacterStream(int parameterIndex) throws java.sql.SQLException
OracleCallableStatement
java.io.Reader
object.
getCharacterStream
in interface OracleCallableStatement
parameterIndex
- the first parameter is 1, the second is 2, and so on
java.io.Reader
java.sql.SQLException
- if an error occurs (conversion or database-access error)public RAW getRAW(int parameterIndex) throws java.sql.SQLException
OracleCallableStatement
oracle.sql.RAW
object.
getRAW
in interface OracleCallableStatement
parameterIndex
- the first parameter is 1, the second is 2, and so on
oracle.sql.RAW
java.sql.SQLException
- if an error occurs (conversion or database-access error)public BLOB getBLOB(int parameterIndex) throws java.sql.SQLException
OracleCallableStatement
oracle.sql.BLOB
object.
getBLOB
in interface OracleCallableStatement
parameterIndex
- the first parameter is 1, the second is 2, and so on
oracle.sql.BLOB
java.sql.SQLException
- if an error occurs (conversion or database-access error)public CLOB getCLOB(int parameterIndex) throws java.sql.SQLException
OracleCallableStatement
oracle.sql.CLOB
object.
getCLOB
in interface OracleCallableStatement
parameterIndex
- the first parameter is 1, the second is 2, and so on
oracle.sql.CLOB
java.sql.SQLException
- if an error occurs (conversion or database-access error)public BFILE getBFILE(int parameterIndex) throws java.sql.SQLException
OracleCallableStatement
oracle.sql.BFILE
object.
getBFILE
in interface OracleCallableStatement
parameterIndex
- the first parameter is 1, the second is 2, and so on
oracle.sql.BFILE
java.sql.SQLException
- if an error occurs (conversion or database-access error)public boolean getBoolean(int parameterIndex) throws java.sql.SQLException
getBoolean
in interface java.sql.CallableStatement
java.sql.SQLException
public byte getByte(int parameterIndex) throws java.sql.SQLException
getByte
in interface java.sql.CallableStatement
java.sql.SQLException
public short getShort(int parameterIndex) throws java.sql.SQLException
getShort
in interface java.sql.CallableStatement
java.sql.SQLException
public int getInt(int parameterIndex) throws java.sql.SQLException
getInt
in interface java.sql.CallableStatement
java.sql.SQLException
public long getLong(int parameterIndex) throws java.sql.SQLException
getLong
in interface java.sql.CallableStatement
java.sql.SQLException
public float getFloat(int parameterIndex) throws java.sql.SQLException
getFloat
in interface java.sql.CallableStatement
java.sql.SQLException
public double getDouble(int parameterIndex) throws java.sql.SQLException
getDouble
in interface java.sql.CallableStatement
java.sql.SQLException
public java.math.BigDecimal getBigDecimal(int parameterIndex, int scale) throws java.sql.SQLException
getBigDecimal
in interface java.sql.CallableStatement
java.sql.SQLException
public byte[] getBytes(int parameterIndex) throws java.sql.SQLException
getBytes
in interface java.sql.CallableStatement
java.sql.SQLException
public java.sql.Date getDate(int parameterIndex) throws java.sql.SQLException
getDate
in interface java.sql.CallableStatement
java.sql.SQLException
public java.sql.Time getTime(int parameterIndex) throws java.sql.SQLException
getTime
in interface java.sql.CallableStatement
java.sql.SQLException
public java.sql.Timestamp getTimestamp(int parameterIndex) throws java.sql.SQLException
getTimestamp
in interface java.sql.CallableStatement
java.sql.SQLException
public java.io.InputStream getAsciiStream(int parameterIndex) throws java.sql.SQLException
OracleCallableStatement
java.io.InputStream
object.
getAsciiStream
in interface OracleCallableStatement
parameterIndex
- the first parameter is 1, the second is 2, and so on
java.io.InputStream
java.sql.SQLException
- if an error occurs (conversion or database-access error)public java.io.InputStream getUnicodeStream(int parameterIndex) throws java.sql.SQLException
OracleCallableStatement
java.io.InputStream
object.
getUnicodeStream
in interface OracleCallableStatement
parameterIndex
- the first parameter is 1, the second is 2, and so on
java.io.InputStream
java.sql.SQLException
- if an error occurs (conversion or database-access error)public java.io.InputStream getBinaryStream(int parameterIndex) throws java.sql.SQLException
OracleCallableStatement
java.io.InputStream
object.
getBinaryStream
in interface OracleCallableStatement
parameterIndex
- the first parameter is 1, the second is 2, and so on
java.io.InputStream
java.sql.SQLException
- if an error occurs (conversion or database-access error)public java.lang.Object getObject(int parameterIndex) throws java.sql.SQLException
getObject
in interface java.sql.CallableStatement
java.sql.SQLException
public java.lang.Object getAnyDataEmbeddedObject(int parameterIndex) throws java.sql.SQLException
OracleCallableStatement
getAnyDataEmbeddedObject
in interface OracleCallableStatement
parameterIndex
- the first parameter is 1
java.sql.SQLException
- if an error occurs (conversion or database-access
error)public java.lang.Object getCustomDatum(int parameterIndex, CustomDatumFactory factory) throws java.sql.SQLException
getCustomDatum
in interface OracleCallableStatement
parameterIndex
- the first parameter is 1, the second is 2, and so onfactory
-
java.sql.SQLException
- if an error occurs (conversion or database-access error)public java.lang.Object getORAData(int parameterIndex, ORADataFactory factory) throws java.sql.SQLException
getORAData
in interface OracleCallableStatement
parameterIndex
- the first parameter is 1, the second is 2, and so onfactory
-
java.sql.SQLException
- if an error occurs (conversion or database-access error)public java.sql.ResultSet getCursor(int parameterIndex) throws java.sql.SQLException
OracleCallableStatement
java.sql.ResultSet
object.
getCursor
in interface OracleCallableStatement
parameterIndex
- the first parameter is 1, the second is 2, and so on
java.sql.ResultSet
java.sql.SQLException
- if an error occurs (conversion or database-access error)public void clearParameters() throws java.sql.SQLException
OraclePreparedStatement
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
clearParameters
in class OraclePreparedStatement
java.sql.SQLException
public java.lang.Object getObject(int parameterIndex, java.util.Map map) throws java.sql.SQLException
getObject
in interface java.sql.CallableStatement
java.sql.SQLException
public java.sql.Ref getRef(int parameterIndex) throws java.sql.SQLException
getRef
in interface java.sql.CallableStatement
java.sql.SQLException
public java.sql.Blob getBlob(int parameterIndex) throws java.sql.SQLException
getBlob
in interface java.sql.CallableStatement
java.sql.SQLException
public java.sql.Clob getClob(int parameterIndex) throws java.sql.SQLException
getClob
in interface java.sql.CallableStatement
java.sql.SQLException
public java.sql.Array getArray(int parameterIndex) throws java.sql.SQLException
getArray
in interface java.sql.CallableStatement
java.sql.SQLException
public java.math.BigDecimal getBigDecimal(int parameterIndex) throws java.sql.SQLException
getBigDecimal
in interface java.sql.CallableStatement
java.sql.SQLException
public java.sql.Date getDate(int parameterIndex, java.util.Calendar cal) throws java.sql.SQLException
getDate
in interface java.sql.CallableStatement
java.sql.SQLException
public java.sql.Time getTime(int parameterIndex, java.util.Calendar cal) throws java.sql.SQLException
getTime
in interface java.sql.CallableStatement
java.sql.SQLException
public java.sql.Timestamp getTimestamp(int parameterIndex, java.util.Calendar cal) throws java.sql.SQLException
getTimestamp
in interface java.sql.CallableStatement
java.sql.SQLException
public void addBatch() throws java.sql.SQLException
addBatch
in interface java.sql.PreparedStatement
addBatch
in class OraclePreparedStatement
java.sql.SQLException
- if an error occurred. Note that stored procedures
with out or inout parameters cannot be batched.public void registerOutParameter(java.lang.String parameterName, int sqlType) throws java.sql.SQLException
parameterName
to the JDBC type
sqlType
. All OUT parameters must be registered
before a stored procedure is executed.
The JDBC type specified by sqlType
for an OUT
parameter determines the Java type that must be used
in the get
method to read the value of that parameter.
If the JDBC type expected to be returned to this output parameter
is specific to this particular database, sqlType
should be java.sql.Types.OTHER
. The method
getObject(int)
retrieves the value.
registerOutParameter
in interface java.sql.CallableStatement
parameterName
- the name of the parametersqlType
- the JDBC type code defined by java.sql.Types
.
If the parameter is of JDBC type NUMERIC
or DECIMAL
, the version of
registerOutParameter
that accepts a scale value
should be used.
java.sql.SQLException
- if a database access error occursTypes
public void registerOutParameter(java.lang.String parameterName, int sqlType, int scale) throws java.sql.SQLException
parameterName
to be of JDBC type
sqlType
. This method must be called
before a stored procedure is executed.
The JDBC type specified by sqlType
for an OUT
parameter determines the Java type that must be used
in the get
method to read the value of that parameter.
This version of registerOutParameter
should be
used when the parameter is of JDBC type NUMERIC
or DECIMAL
.
registerOutParameter
in interface java.sql.CallableStatement
parameterName
- the name of the parametersqlType
- SQL type code defined by java.sql.Types
.scale
- the desired number of digits to the right of the
decimal point. It must be greater than or equal to zero.
java.sql.SQLException
- if a database access error occursTypes
public void registerOutParameter(java.lang.String parameterName, int sqlType, java.lang.String typeName) throws java.sql.SQLException
registerOutParameter
should be used for a user-named or REF output parameter. Examples
of user-named types include: STRUCT, DISTINCT, JAVA_OBJECT, and
named array types.
Before executing a stored procedure call, you must explicitly
call registerOutParameter
to register the type from
java.sql.Types
for each
OUT parameter. For a user-named parameter the fully-qualified SQL
type name of the parameter should also be given, while a REF
parameter requires that the fully-qualified type name of the
referenced type be given. A JDBC driver that does not need the
type code and type name information may ignore it. To be portable,
however, applications should always provide these values for
user-named and REF parameters.
Although it is intended for user-named and REF parameters,
this method may be used to register a parameter of any JDBC type.
If the parameter does not have a user-named or REF type, the
typeName parameter is ignored.
Note: When reading the value of an out parameter, you
must use the getXXX
method whose Java type XXX corresponds to the
parameter's registered SQL type.
registerOutParameter
in interface java.sql.CallableStatement
parameterName
- the name of the parametersqlType
- a value from Types
typeName
- the fully-qualified name of an SQL structured type
java.sql.SQLException
- if a database access error occursTypes
public java.net.URL getURL(int parameterIndex) throws java.sql.SQLException
DATALINK
parameter as a
java.net.URL
object.
getURL
in interface java.sql.CallableStatement
parameterIndex
- the first parameter is 1, the second is 2,...
java.net.URL
object that represents the
JDBC DATALINK
value used as the designated
parameter
java.sql.SQLException
- if a database access error occurs,
or if the URL being returned is
not a valid URL on the Java platformsetURL(java.lang.String, java.net.URL)
public void setURL(java.lang.String parameterName, java.net.URL val) throws java.sql.SQLException
java.net.URL
object.
The driver converts this to an SQL DATALINK
value when
it sends it to the database.
setURL
in interface java.sql.CallableStatement
parameterName
- the name of the parameterval
- the parameter value
java.sql.SQLException
- if a database access error occurs,
or if a URL is malformedgetURL(int)
public void setNull(java.lang.String parameterName, int sqlType) throws java.sql.SQLException
NULL
.
Note: You must specify the parameter's SQL type.
setNull
in interface java.sql.CallableStatement
parameterName
- the name of the parametersqlType
- the SQL type code defined in java.sql.Types
java.sql.SQLException
- if a database access error occurspublic void setBoolean(java.lang.String parameterName, boolean x) throws java.sql.SQLException
boolean
value.
The driver converts this
to an SQL BIT
value when it sends it to the database.
setBoolean
in interface java.sql.CallableStatement
parameterName
- the name of the parameterx
- the parameter value
java.sql.SQLException
- if a database access error occursgetBoolean(int)
public void setByte(java.lang.String parameterName, byte x) throws java.sql.SQLException
byte
value.
The driver converts this
to an SQL TINYINT
value when it sends it to the database.
setByte
in interface java.sql.CallableStatement
parameterName
- the name of the parameterx
- the parameter value
java.sql.SQLException
- if a database access error occursgetByte(int)
public void setShort(java.lang.String parameterName, short x) throws java.sql.SQLException
short
value.
The driver converts this
to an SQL SMALLINT
value when it sends it to the database.
setShort
in interface java.sql.CallableStatement
parameterName
- the name of the parameterx
- the parameter value
java.sql.SQLException
- if a database access error occursgetShort(int)
public void setInt(java.lang.String parameterName, int x) throws java.sql.SQLException
int
value.
The driver converts this
to an SQL INTEGER
value when it sends it to the database.
setInt
in interface java.sql.CallableStatement
parameterName
- the name of the parameterx
- the parameter value
java.sql.SQLException
- if a database access error occursgetInt(int)
public void setLong(java.lang.String parameterName, long x) throws java.sql.SQLException
long
value.
The driver converts this
to an SQL BIGINT
value when it sends it to the database.
setLong
in interface java.sql.CallableStatement
parameterName
- the name of the parameterx
- the parameter value
java.sql.SQLException
- if a database access error occursgetLong(int)
public void setFloat(java.lang.String parameterName, float x) throws java.sql.SQLException
float
value.
The driver converts this
to an SQL FLOAT
value when it sends it to the database.
setFloat
in interface java.sql.CallableStatement
parameterName
- the name of the parameterx
- the parameter value
java.sql.SQLException
- if a database access error occursgetFloat(int)
public void setBinaryFloat(java.lang.String parameterName, float x) throws java.sql.SQLException
float
value.
The driver converts this
to an SQL BINARY_FLOAT
value when it sends it to the database.
parameterName
- the name of the parameterx
- the parameter value
java.sql.SQLException
- if a database access error occursgetFloat(int)
public void setBinaryFloat(java.lang.String parameterName, BINARY_FLOAT x) throws java.sql.SQLException
oracle.sql.BINARY_FLOAT
value.
setBinaryFloat
in interface OracleCallableStatement
parameterName
- the name of the parameterx
- the parameter value
java.sql.SQLException
- if a database access error occursgetFloat(int)
public void setDouble(java.lang.String parameterName, double x) throws java.sql.SQLException
double
value.
The driver converts this
to an SQL DOUBLE
value when it sends it to the database.
setDouble
in interface java.sql.CallableStatement
parameterName
- the name of the parameterx
- the parameter value
java.sql.SQLException
- if a database access error occursgetDouble(int)
public void setBinaryDouble(java.lang.String parameterName, double x) throws java.sql.SQLException
double
value.
The driver converts this
to an SQL BINARY_DOUBLE
value when it sends it to the database.
parameterName
- the name of the parameterx
- the parameter value
java.sql.SQLException
- if a database access error occursgetDouble(int)
public void setBinaryDouble(java.lang.String parameterName, BINARY_DOUBLE x) throws java.sql.SQLException
oracle.sql.BINARY_FLOAT
value.
setBinaryDouble
in interface OracleCallableStatement
parameterName
- the name of the parameterx
- the parameter value
java.sql.SQLException
- if a database access error occursgetDouble(int)
public void setBigDecimal(java.lang.String parameterName, java.math.BigDecimal x) throws java.sql.SQLException
java.math.BigDecimal
value.
The driver converts this to an SQL NUMERIC
value when
it sends it to the database.
setBigDecimal
in interface java.sql.CallableStatement
parameterName
- the name of the parameterx
- the parameter value
java.sql.SQLException
- if a database access error occursgetBigDecimal(int, int)
public void setString(java.lang.String parameterName, java.lang.String x) throws java.sql.SQLException
String
value.
The driver converts this
to an SQL VARCHAR
or LONGVARCHAR
value
(depending on the argument's
size relative to the driver's limits on VARCHAR
values)
when it sends it to the database.
setString
in interface java.sql.CallableStatement
parameterName
- the name of the parameterx
- the parameter value
java.sql.SQLException
- if a database access error occursgetString(int)
public void setStringForClob(java.lang.String parameterName, java.lang.String x) throws java.sql.SQLException
String
value.
The driver converts this
to an SQL VARCHAR
or LONGVARCHAR
value
(depending on the argument's
size relative to the driver's limits on VARCHAR
values)
when it sends it to the database. If the string is larger than
32765 it is converted to a temporary clob and that is sent
to the database.
This clob conversion produces data truncation for columns of type
VARCHAR
and LONGVARCHAR
.
setStringForClob
in interface OracleCallableStatement
parameterName
- the name of the parameterx
- the parameter value
java.sql.SQLException
- if a database access error occursgetString(int)
public void setBytes(java.lang.String parameterName, byte[] x) throws java.sql.SQLException
VARBINARY
or
LONGVARBINARY
(depending on the argument's size relative
to the driver's limits on VARBINARY
values) when it sends
it to the database.
setBytes
in interface java.sql.CallableStatement
parameterName
- the name of the parameterx
- the parameter value
java.sql.SQLException
- if a database access error occursgetBytes(int)
public void setDate(java.lang.String parameterName, java.sql.Date x) throws java.sql.SQLException
java.sql.Date
value.
The driver converts this
to an SQL DATE
value when it sends it to the database.
setDate
in interface java.sql.CallableStatement
parameterName
- the name of the parameterx
- the parameter value
java.sql.SQLException
- if a database access error occursgetDate(int)
public void setTime(java.lang.String parameterName, java.sql.Time x) throws java.sql.SQLException
java.sql.Time
value.
The driver converts this
to an SQL TIME
value when it sends it to the database.
setTime
in interface java.sql.CallableStatement
parameterName
- the name of the parameterx
- the parameter value
java.sql.SQLException
- if a database access error occursgetTime(int)
public void setTimestamp(java.lang.String parameterName, java.sql.Timestamp x) throws java.sql.SQLException
java.sql.Timestamp
value.
The driver
converts this to an SQL TIMESTAMP
value when it sends it to the
database.
setTimestamp
in interface java.sql.CallableStatement
parameterName
- the name of the parameterx
- the parameter value
java.sql.SQLException
- if a database access error occursgetTimestamp(int)
public void setAsciiStream(java.lang.String parameterName, java.io.InputStream x, int length) throws java.sql.SQLException
LONGVARCHAR
parameter, it may be more practical to send it via a
java.io.InputStream
. Data will be read from the stream
as needed until end-of-file is reached. The JDBC driver will
do any necessary conversion from ASCII to the database char format.
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
setAsciiStream
in interface java.sql.CallableStatement
parameterName
- the name of the parameterx
- 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 setBinaryStream(java.lang.String parameterName, java.io.InputStream x, int length) throws java.sql.SQLException
LONGVARBINARY
parameter, it may be more practical to send it via a
java.io.InputStream
object. The data will be read from the stream
as needed until end-of-file is reached.
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
setBinaryStream
in interface java.sql.CallableStatement
parameterName
- the name of the parameterx
- 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 setObject(java.lang.String parameterName, java.lang.Object x, int targetSqlType, int scale) throws java.sql.SQLException
java.lang
equivalent objects should be used.
The given Java object will be converted to the given targetSqlType
before being sent to the database.
If the object has a custom mapping (is of a class implementing the
interface SQLData
),
the JDBC driver should call the method SQLData.writeSQL
to write it
to the SQL data stream.
If, on the other hand, the object is of a class implementing
Ref
, Blob
, Clob
, Struct
,
or Array
, the driver should pass it to the database as a
value of the corresponding SQL type.
Note that this method may be used to pass datatabase- specific abstract data types.
setObject
in interface java.sql.CallableStatement
parameterName
- the name of the parameterx
- the object containing the input parameter valuetargetSqlType
- the SQL type (as defined in java.sql.Types) to be
sent to the database. The scale argument may further qualify this type.scale
- for java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types,
this is the number of digits after the decimal point. For all other
types, this value will be ignored.
java.sql.SQLException
- if a database access error occursTypes
,
getObject(int)
public void setObject(java.lang.String parameterName, java.lang.Object x, int targetSqlType) throws java.sql.SQLException
setObject
above, except that it assumes a scale of zero.
setObject
in interface java.sql.CallableStatement
parameterName
- the name of the parameterx
- 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 occursgetObject(int)
public void setObject(java.lang.String parameterName, java.lang.Object x) throws java.sql.SQLException
Object
; therefore, the
java.lang
equivalent objects should be used for built-in types.
The JDBC specification specifies a standard mapping from
Java Object
types to SQL types. The given argument
will be converted to the corresponding SQL type before being
sent to the database.
Note that this method may be used to pass datatabase-
specific abstract data types, by using a driver-specific Java
type.
If the object is of a class implementing the interface SQLData
,
the JDBC driver should call the method SQLData.writeSQL
to write it to the SQL data stream.
If, on the other hand, the object is of a class implementing
Ref
, Blob
, Clob
, Struct
,
or Array
, the driver should pass it to the database as a
value of the corresponding SQL type.
This method throws an exception if there is an ambiguity, for example, if the object is of a class implementing more than one of the interfaces named above.
setObject
in interface java.sql.CallableStatement
parameterName
- the name of the parameterx
- the object containing the input parameter value
java.sql.SQLException
- if a database access error occurs or if the given
Object
parameter is ambiguousgetObject(int)
public void setCharacterStream(java.lang.String parameterName, 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 LONGVARCHAR
parameter, it may be more practical to send it via a
java.io.Reader
object. The data will be read from the stream
as needed until end-of-file is reached. The JDBC driver will
do any necessary conversion from UNICODE to the database char format.
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
setCharacterStream
in interface java.sql.CallableStatement
parameterName
- the name of the parameterreader
- the java.io.Reader
object that
contains the UNICODE data used as the designated parameterlength
- the number of characters in the stream
java.sql.SQLException
- if a database access error occurspublic void setDate(java.lang.String parameterName, java.sql.Date x, java.util.Calendar cal) throws java.sql.SQLException
java.sql.Date
value,
using the given Calendar
object. The driver uses
the Calendar
object to construct an SQL DATE
value,
which the driver then sends to the database. With a
a Calendar
object, the driver can calculate the date
taking into account a custom timezone. If no
Calendar
object is specified, the driver uses the default
timezone, which is that of the virtual machine running the application.
setDate
in interface java.sql.CallableStatement
parameterName
- the name of the parameterx
- the parameter valuecal
- the Calendar
object the driver will use
to construct the date
java.sql.SQLException
- if a database access error occursgetDate(int)
public void setTime(java.lang.String parameterName, java.sql.Time x, java.util.Calendar cal) throws java.sql.SQLException
java.sql.Time
value,
using the given Calendar
object. The driver uses
the Calendar
object to construct an SQL TIME
value,
which the driver then sends to the database. With a
a Calendar
object, the driver can calculate the time
taking into account a custom timezone. If no
Calendar
object is specified, the driver uses the default
timezone, which is that of the virtual machine running the application.
setTime
in interface java.sql.CallableStatement
parameterName
- the name of the parameterx
- the parameter valuecal
- the Calendar
object the driver will use
to construct the time
java.sql.SQLException
- if a database access error occursgetTime(int)
public void setTimestamp(java.lang.String parameterName, java.sql.Timestamp x, java.util.Calendar cal) throws java.sql.SQLException
java.sql.Timestamp
value,
using the given Calendar
object. The driver uses
the Calendar
object to construct an SQL TIMESTAMP
value,
which the driver then sends to the database. With a
a Calendar
object, the driver can calculate the timestamp
taking into account a custom timezone. If no
Calendar
object is specified, the driver uses the default
timezone, which is that of the virtual machine running the application.
setTimestamp
in interface java.sql.CallableStatement
parameterName
- the name of the parameterx
- the parameter valuecal
- the Calendar
object the driver will use
to construct the timestamp
java.sql.SQLException
- if a database access error occursgetTimestamp(int)
public void setNull(java.lang.String parameterName, int sqlType, java.lang.String typeName) throws java.sql.SQLException
NULL
.
This version of the method setNull
should
be used for user-defined types and REF type parameters. Examples
of user-defined types include: STRUCT, DISTINCT, JAVA_OBJECT, and
named array types.
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-defined 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. If a JDBC driver does not need the type code or type name information, it may ignore it. Although it is intended for user-defined 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-defined or REF type, the given typeName is ignored.
setNull
in interface java.sql.CallableStatement
sqlType
- a value from java.sql.Types
typeName
- the fully-qualified name of an SQL user-defined type;
ignored if the parameter is not a user-defined type or
SQL REF
value
java.sql.SQLException
- if a database access error occurspublic java.lang.String getString(java.lang.String parameterName) throws java.sql.SQLException
CHAR
, VARCHAR
,
or LONGVARCHAR
parameter as a String
in
the Java programming language.
For the fixed-length type JDBC CHAR
,
the String
object
returned has exactly the same value the JDBC
CHAR
value had in the
database, including any padding added by the database.
getString
in interface java.sql.CallableStatement
parameterName
- the name of the parameter
NULL
, the result
is null
.
java.sql.SQLException
- if a database access error occurssetString(java.lang.String, java.lang.String)
public boolean getBoolean(java.lang.String parameterName) throws java.sql.SQLException
BIT
parameter as a
boolean
in the Java programming language.
getBoolean
in interface java.sql.CallableStatement
parameterName
- the name of the parameter
NULL
, the result
is false
.
java.sql.SQLException
- if a database access error occurssetBoolean(java.lang.String, boolean)
public byte getByte(java.lang.String parameterName) throws java.sql.SQLException
TINYINT
parameter as a byte
in the Java programming language.
getByte
in interface java.sql.CallableStatement
parameterName
- the name of the parameter
NULL
, the result
is 0
.
java.sql.SQLException
- if a database access error occurssetByte(java.lang.String, byte)
public short getShort(java.lang.String parameterName) throws java.sql.SQLException
SMALLINT
parameter as a short
in the Java programming language.
getShort
in interface java.sql.CallableStatement
parameterName
- the name of the parameter
NULL
, the result
is 0
.
java.sql.SQLException
- if a database access error occurssetShort(java.lang.String, short)
public int getInt(java.lang.String parameterName) throws java.sql.SQLException
INTEGER
parameter as an int
in the Java programming language.
getInt
in interface java.sql.CallableStatement
parameterName
- the name of the parameter
NULL
,
the result is 0
.
java.sql.SQLException
- if a database access error occurssetInt(java.lang.String, int)
public long getLong(java.lang.String parameterName) throws java.sql.SQLException
BIGINT
parameter as a long
in the Java programming language.
getLong
in interface java.sql.CallableStatement
parameterName
- the name of the parameter
NULL
,
the result is 0
.
java.sql.SQLException
- if a database access error occurssetLong(java.lang.String, long)
public float getFloat(java.lang.String parameterName) throws java.sql.SQLException
FLOAT
parameter as a float
in the Java programming language.
getFloat
in interface java.sql.CallableStatement
parameterName
- the name of the parameter
NULL
,
the result is 0
.
java.sql.SQLException
- if a database access error occurssetFloat(java.lang.String, float)
public double getDouble(java.lang.String parameterName) throws java.sql.SQLException
DOUBLE
parameter as a double
in the Java programming language.
getDouble
in interface java.sql.CallableStatement
parameterName
- the name of the parameter
NULL
,
the result is 0
.
java.sql.SQLException
- if a database access error occurssetDouble(java.lang.String, double)
public byte[] getBytes(java.lang.String parameterName) throws java.sql.SQLException
BINARY
or VARBINARY
parameter as an array of byte
values in the Java
programming language.
getBytes
in interface java.sql.CallableStatement
parameterName
- the name of the parameter
NULL
, the result is
null
.
java.sql.SQLException
- if a database access error occurssetBytes(java.lang.String, byte[])
public java.sql.Date getDate(java.lang.String parameterName) throws java.sql.SQLException
DATE
parameter as a
java.sql.Date
object.
getDate
in interface java.sql.CallableStatement
parameterName
- the name of the parameter
NULL
, the result
is null
.
java.sql.SQLException
- if a database access error occurssetDate(java.lang.String, java.sql.Date)
public java.sql.Time getTime(java.lang.String parameterName) throws java.sql.SQLException
TIME
parameter as a
java.sql.Time
object.
getTime
in interface java.sql.CallableStatement
parameterName
- the name of the parameter
NULL
, the result
is null
.
java.sql.SQLException
- if a database access error occurssetTime(java.lang.String, java.sql.Time)
public java.sql.Timestamp getTimestamp(java.lang.String parameterName) throws java.sql.SQLException
TIMESTAMP
parameter as a
java.sql.Timestamp
object.
getTimestamp
in interface java.sql.CallableStatement
parameterName
- the name of the parameter
NULL
, the result
is null
.
java.sql.SQLException
- if a database access error occurssetTimestamp(java.lang.String, java.sql.Timestamp)
public java.lang.Object getObject(java.lang.String parameterName) throws java.sql.SQLException
Object
in the Java
programming language. If the value is an SQL NULL
, the
driver returns a Java null
.
This method returns a Java object whose type corresponds to the JDBC
type that was registered for this parameter using the method
registerOutParameter
. By registering the target JDBC
type as java.sql.Types.OTHER
, this method can be used
to read database-specific abstract data types.
getObject
in interface java.sql.CallableStatement
parameterName
- the name of the parameter
java.lang.Object
holding the OUT parameter value.
java.sql.SQLException
- if a database access error occursTypes
,
setObject(java.lang.String, java.lang.Object, int, int)
public java.math.BigDecimal getBigDecimal(java.lang.String parameterName) throws java.sql.SQLException
NUMERIC
parameter as a
java.math.BigDecimal
object with as many digits to the
right of the decimal point as the value contains.
getBigDecimal
in interface java.sql.CallableStatement
parameterName
- the name of the parameter
NULL
, the result is null
.
java.sql.SQLException
- if a database access error occurssetBigDecimal(java.lang.String, java.math.BigDecimal)
public java.lang.Object getObject(java.lang.String parameterName, java.util.Map map) throws java.sql.SQLException
i
and uses map
for the custom
mapping of the parameter value.
This method returns a Java object whose type corresponds to the
JDBC type that was registered for this parameter using the method
registerOutParameter
. By registering the target
JDBC type as java.sql.Types.OTHER
, this method can
be used to read database-specific abstract data types.
getObject
in interface java.sql.CallableStatement
parameterName
- the name of the parametermap
- the mapping from SQL type names to Java classes
java.lang.Object
holding the OUT parameter value
java.sql.SQLException
- if a database access error occurssetObject(java.lang.String, java.lang.Object, int, int)
public java.sql.Ref getRef(java.lang.String parameterName) throws java.sql.SQLException
REF(<structured-type>)
parameter as a Ref
object in the Java programming language.
getRef
in interface java.sql.CallableStatement
parameterName
- the name of the parameter
Ref
object in the
Java programming language. If the value was SQL NULL
,
the value null
is returned.
java.sql.SQLException
- if a database access error occurspublic java.sql.Blob getBlob(java.lang.String parameterName) throws java.sql.SQLException
BLOB
parameter as a
Blob
object in the Java programming language.
getBlob
in interface java.sql.CallableStatement
parameterName
- the name of the parameter
Blob
object in the
Java programming language. If the value was SQL NULL
,
the value null
is returned.
java.sql.SQLException
- if a database access error occurspublic java.sql.Clob getClob(java.lang.String parameterName) throws java.sql.SQLException
CLOB
parameter as a
Clob
object in the Java programming language.
getClob
in interface java.sql.CallableStatement
parameterName
- the name of the parameter
Clob
object in the
Java programming language. If the value was SQL NULL
,
the value null
is returned.
java.sql.SQLException
- if a database access error occurspublic java.sql.Array getArray(java.lang.String parameterName) throws java.sql.SQLException
ARRAY
parameter as an
Array
object in the Java programming language.
getArray
in interface java.sql.CallableStatement
parameterName
- the name of the parameter
Array
object in
Java programming language. If the value was SQL NULL
,
the value null
is returned.
java.sql.SQLException
- if a database access error occurspublic java.sql.Date getDate(java.lang.String parameterName, java.util.Calendar cal) throws java.sql.SQLException
DATE
parameter as a
java.sql.Date
object, using
the given Calendar
object
to construct the date.
With a Calendar
object, the driver
can calculate the date taking into account a custom timezone and locale.
If no Calendar
object is specified, the driver uses the
default timezone and locale.
getDate
in interface java.sql.CallableStatement
parameterName
- the name of the parametercal
- the Calendar
object the driver will use
to construct the date
NULL
,
the result is null
.
java.sql.SQLException
- if a database access error occurssetDate(java.lang.String, java.sql.Date)
public java.sql.Time getTime(java.lang.String parameterName, java.util.Calendar cal) throws java.sql.SQLException
TIME
parameter as a
java.sql.Time
object, using
the given Calendar
object
to construct the time.
With a Calendar
object, the driver
can calculate the time taking into account a custom timezone and locale.
If no Calendar
object is specified, the driver uses the
default timezone and locale.
getTime
in interface java.sql.CallableStatement
parameterName
- the name of the parametercal
- the Calendar
object the driver will use
to construct the time
NULL
, the result is
null
.
java.sql.SQLException
- if a database access error occurssetTime(java.lang.String, java.sql.Time)
public java.sql.Timestamp getTimestamp(java.lang.String parameterName, java.util.Calendar cal) throws java.sql.SQLException
TIMESTAMP
parameter as a
java.sql.Timestamp
object, using
the given Calendar
object to construct
the Timestamp
object.
With a Calendar
object, the driver
can calculate the timestamp taking into account a custom timezone and locale.
If no Calendar
object is specified, the driver uses the
default timezone and locale.
getTimestamp
in interface java.sql.CallableStatement
parameterName
- the name of the parametercal
- the Calendar
object the driver will use
to construct the timestamp
NULL
, the result is
null
.
java.sql.SQLException
- if a database access error occurssetTimestamp(java.lang.String, java.sql.Timestamp)
public java.net.URL getURL(java.lang.String parameterName) throws java.sql.SQLException
DATALINK
parameter as a
java.net.URL
object.
getURL
in interface java.sql.CallableStatement
parameterName
- the name of the parameter
java.net.URL
object in the
Java programming language. If the value was SQL NULL
, the
value null
is returned.
java.sql.SQLException
- if a database access error occurs,
or if there is a problem with the URLsetURL(java.lang.String, java.net.URL)
public void registerIndexTableOutParameter(int paramIndex, int maxLen, int elemSqlType, int elemMaxLen) throws java.sql.SQLException
registerIndexTableOutParameter
in interface OracleCallableStatement
paramIndex
- parameter index.maxLen
- the maximum possible number of elements.elemSqlType
- 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 sqlType is invalid, or an error occurred.public java.lang.Object getPlsqlIndexTable(int paramIndex) throws java.sql.SQLException
getPlsqlIndexTable
in interface OracleCallableStatement
paramIndex
- the first parameter is 1, the second is 2, and so on
java.sql.SQLException
- if a database-access error occurs.public java.lang.Object getPlsqlIndexTable(int paramIndex, java.lang.Class primitiveType) throws java.sql.SQLException
getPlsqlIndexTable
in interface OracleCallableStatement
primitiveType
- is a primitive type class.
For example,java.lang.Double.TypeparamIndex
- the first parameter is 1, the second is 2, and so on
java.sql.SQLException
- if a database-access error occurs.public Datum[] getOraclePlsqlIndexTable(int parameterIndex) throws java.sql.SQLException
getOraclePlsqlIndexTable
in interface OracleCallableStatement
parameterIndex
- the first column is 1, the second is 2, ...
java.sql.SQLException
- if a database-access error occurs.public boolean execute() throws java.sql.SQLException
execute
in interface java.sql.PreparedStatement
execute
in class OraclePreparedStatement
java.sql.SQLException
- if error(s) occurred.public int executeUpdate() throws java.sql.SQLException
executeUpdate
in interface java.sql.PreparedStatement
executeUpdate
in class OraclePreparedStatement
java.sql.SQLException
- if error(s) occurred.public void setNull(int paramIndex, int x, java.lang.String y) throws java.sql.SQLException
OraclePreparedStatement
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
setNull
in class OraclePreparedStatement
x
- a value from java.sql.Types
java.sql.SQLException
- if a database access error occurspublic void setNull(int paramIndex, int x) throws java.sql.SQLException
OraclePreparedStatement
Note: You must specify the parameter's SQL type.
setNull
in interface java.sql.PreparedStatement
setNull
in class OraclePreparedStatement
x
- the SQL type code defined in java.sql.Types
java.sql.SQLException
- if a database access error occurspublic void setBoolean(int paramIndex, boolean x) throws java.sql.SQLException
OraclePreparedStatement
setBoolean
in interface java.sql.PreparedStatement
setBoolean
in class OraclePreparedStatement
x
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setByte(int paramIndex, byte x) throws java.sql.SQLException
OraclePreparedStatement
setByte
in interface java.sql.PreparedStatement
setByte
in class OraclePreparedStatement
x
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setShort(int paramIndex, short x) throws java.sql.SQLException
OraclePreparedStatement
setShort
in interface java.sql.PreparedStatement
setShort
in class OraclePreparedStatement
x
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setInt(int paramIndex, int x) throws java.sql.SQLException
OraclePreparedStatement
setInt
in interface java.sql.PreparedStatement
setInt
in class OraclePreparedStatement
x
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setLong(int paramIndex, long x) throws java.sql.SQLException
OraclePreparedStatement
setLong
in interface java.sql.PreparedStatement
setLong
in class OraclePreparedStatement
x
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setFloat(int paramIndex, float x) throws java.sql.SQLException
OraclePreparedStatement
setFloat
in interface java.sql.PreparedStatement
setFloat
in class OraclePreparedStatement
x
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setBinaryFloat(int paramIndex, float x) throws java.sql.SQLException
OraclePreparedStatement
setBinaryFloat
in interface OraclePreparedStatement
setBinaryFloat
in class OraclePreparedStatement
x
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setBinaryFloat(int paramIndex, BINARY_FLOAT x) throws java.sql.SQLException
OraclePreparedStatement
setBinaryFloat
in interface OraclePreparedStatement
setBinaryFloat
in class OraclePreparedStatement
java.sql.SQLException
public void setBinaryDouble(int paramIndex, double x) throws java.sql.SQLException
OraclePreparedStatement
setBinaryDouble
in interface OraclePreparedStatement
setBinaryDouble
in class OraclePreparedStatement
x
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setBinaryDouble(int paramIndex, BINARY_DOUBLE x) throws java.sql.SQLException
OraclePreparedStatement
setBinaryDouble
in interface OraclePreparedStatement
setBinaryDouble
in class OraclePreparedStatement
java.sql.SQLException
- if a database access error occurspublic void setDouble(int paramIndex, double x) throws java.sql.SQLException
OraclePreparedStatement
setDouble
in interface java.sql.PreparedStatement
setDouble
in class OraclePreparedStatement
x
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setBigDecimal(int paramIndex, java.math.BigDecimal x) throws java.sql.SQLException
OraclePreparedStatement
setBigDecimal
in interface java.sql.PreparedStatement
setBigDecimal
in class OraclePreparedStatement
x
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setString(int paramIndex, java.lang.String x) throws java.sql.SQLException
OraclePreparedStatement
setString
in interface java.sql.PreparedStatement
setString
in class OraclePreparedStatement
x
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setFixedCHAR(int paramIndex, java.lang.String x) throws java.sql.SQLException
OraclePreparedStatement
String
and executes a
non-padded comparison with a SQL CHAR.
CHAR data in the database is padded to the column width. This leads to a
limitation in using the setCHAR()
method to bind character
data into the WHERE
clause of a SELECT
statement--the character data in the WHERE
clause must also be
padded to the column width to produce a match in the SELECT
statement. This is especially troublesome if you do not know the column
width.
setFixedCHAR()
remedies this. This method executes a
non-padded comparison.
Notes:
OraclePreparedStatement
to use the setFixedCHAR()
method.The following example demonstrates the difference between the
setString()
, setCHAR()
and
setFixedCHAR()
methods.
// Schema is : create table my_table (col1 char(10)); // insert into my_table values ('JDBC'); PreparedStatement pstmt = conn.prepareStatement ("select count() from my_table where col1 = ?"); ResultSet rs; pstmt.setString (1, "JDBC"); // Set the Bind Value rs = pstmt.executeQuery(); // This does not match any row // ... do something with rs CHAR ch = new CHAR("JDBC ", null); ((OraclePreparedStatement)pstmt).setCHAR(1, ch); // Pad it to 10 bytes rs = pstmt.executeQuery(); // This matches one row // ... do something with rs ((OraclePreparedStatement)pstmt).setFixedCHAR(1, "JDBC"); rs = pstmt.executeQuery(); // This matches one row // ... do something with rs
setFixedCHAR
in interface OraclePreparedStatement
setFixedCHAR
in class OraclePreparedStatement
paramIndex
- index of the bind variablex
- the literal/variable to be bound.
java.sql.SQLException
- error while bindingpublic void setCursor(int paramIndex, java.sql.ResultSet x) throws java.sql.SQLException
OraclePreparedStatement
java.sql.ResultSet
. This
is used for RefCursor parameter only.
NOTE: The method is a misnomer. You should use CURSOR only in callable statements.
setCursor
in interface OraclePreparedStatement
java.sql.SQLException
- if a database access error occurspublic void setROWID(int paramIndex, ROWID x) throws java.sql.SQLException
OraclePreparedStatement
oracle.sql.ROWID
value.
setROWID
in interface OraclePreparedStatement
setROWID
in class OraclePreparedStatement
java.sql.SQLException
- if a database access error occurspublic void setArray(int paramIndex, java.sql.Array x) throws java.sql.SQLException
OraclePreparedStatement
setArray
in interface java.sql.PreparedStatement
setArray
in class OraclePreparedStatement
java.sql.SQLException
- if a database access error occurspublic void setARRAY(int paramIndex, ARRAY x) throws java.sql.SQLException
OraclePreparedStatement
oracle.sql.ARRAY
.
setARRAY
in interface OraclePreparedStatement
setARRAY
in class OraclePreparedStatement
java.sql.SQLException
- if a database access error occurspublic void setOPAQUE(int paramIndex, OPAQUE x) throws java.sql.SQLException
OraclePreparedStatement
oracle.sql.OPAQUE
value.
setOPAQUE
in interface OraclePreparedStatement
setOPAQUE
in class OraclePreparedStatement
java.sql.SQLException
- if a database access error occurspublic void setStructDescriptor(int paramIndex, StructDescriptor x) throws java.sql.SQLException
OraclePreparedStatement
setStructDescriptor
in interface OraclePreparedStatement
setStructDescriptor
in class OraclePreparedStatement
java.sql.SQLException
- if a database access error occurspublic void setSTRUCT(int paramIndex, STRUCT x) throws java.sql.SQLException
OraclePreparedStatement
oracle.sql.STRUCT
value.
setSTRUCT
in interface OraclePreparedStatement
setSTRUCT
in class OraclePreparedStatement
java.sql.SQLException
- if a database access error occurspublic void setRAW(int paramIndex, RAW x) throws java.sql.SQLException
OraclePreparedStatement
oracle.sql.RAW
value.
setRAW
in interface OraclePreparedStatement
setRAW
in class OraclePreparedStatement
java.sql.SQLException
- if a database access error occurspublic void setCHAR(int paramIndex, CHAR x) throws java.sql.SQLException
OraclePreparedStatement
oracle.sql.CHAR
value.
setCHAR
checks the character set of the argument. If it is
not the same as the network character set, then the bytes of the argument
are converted to the network character set and those bytes are sent to the
database. The conversion between the argument character set and the network
character set is via the Universal Character Set (UCS2). That is, the
argument is converted to UCS2, then the UCS2 bytes are converted to the
network character set.
Note: If an input character does not have a representation in
UCS2, or if the UCS2 does not have a representation of the network
character set, setCHAR
will throw an exception.
setCHAR
in interface OraclePreparedStatement
setCHAR
in class OraclePreparedStatement
java.sql.SQLException
- if a database access error occurspublic void setDATE(int paramIndex, DATE x) throws java.sql.SQLException
OraclePreparedStatement
oracle.sql.DATE
value.
setDATE
in interface OraclePreparedStatement
setDATE
in class OraclePreparedStatement
x
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setNUMBER(int paramIndex, NUMBER x) throws java.sql.SQLException
OraclePreparedStatement
oracle.sql.NUMBER
value.
setNUMBER
in interface OraclePreparedStatement
setNUMBER
in class OraclePreparedStatement
x
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setBLOB(int paramIndex, BLOB x) throws java.sql.SQLException
OraclePreparedStatement
oracle.sql.BLOB
value.
Note: An instance of the oracle.sql.BLOB
class
contains only the locator of the BLOB, not the data. Thus, this method
binds the designated parameter to a BLOB locator not to the data.
For example, if you have an OraclePreparedStatement
object
ops
and a BLOB named my_blob
, then write the BLOB
to the database as follows:
OraclePreparedStatement ops = (OraclePreparedStatement)conn.prepareStatement ("INSERT INTO blob_table VALUES(?)"); ops.setBLOB(1, my_blob); ops.execute();
This stores only the locator of the BLOB in the
clob_table
. Use the method BLOB.getBinaryOutputStream
to write data to a BLOB.
setBLOB
in interface OraclePreparedStatement
setBLOB
in class OraclePreparedStatement
java.sql.SQLException
- if a database access error occurspublic void setBlob(int paramIndex, java.sql.Blob x) throws java.sql.SQLException
OraclePreparedStatement
setBlob
in interface java.sql.PreparedStatement
setBlob
in class OraclePreparedStatement
java.sql.SQLException
- if a database access error occurspublic void setCLOB(int paramIndex, CLOB x) throws java.sql.SQLException
OraclePreparedStatement
oracle.sql.CLOB
value.
Note: An instance of the oracle.sql.CLOB
class
contains only the locator of the CLOB, not the data. Thus, this method
binds the designated parameter to a CLOB locator not to the data.
For example, if you have an OraclePreparedStatement
object
ops
and a CLOB named my_clob
, then write the CLOB
to the database as follows:
OraclePreparedStatement ops = (OraclePreparedStatement)conn.prepareStatement ("INSERT INTO clob_table VALUES(?)"); ops.setCLOB(1, my_clob); ops.execute();
This stores only the locator of the CLOB in the
clob_table
. Use the methods CLOB.getCharacterOutputStream
or CLOB.getAsciiOutputStream
to write data to a CLOB.
setCLOB
in interface OraclePreparedStatement
setCLOB
in class OraclePreparedStatement
java.sql.SQLException
- if a database access error occurspublic void setClob(int paramIndex, java.sql.Clob x) throws java.sql.SQLException
OraclePreparedStatement
setClob
in interface java.sql.PreparedStatement
setClob
in class OraclePreparedStatement
java.sql.SQLException
- if a database access error occurspublic void setBFILE(int paramIndex, BFILE x) throws java.sql.SQLException
OraclePreparedStatement
oracle.sql.BFILE
value.
Note: An instance of the oracle.sql.BFILE
class
contains only the locator of the BFILE, not the data. Thus, this method
binds the designated parameter to a BFILE locator not to the data.
For example, assume you want to insert a BFILE locator into a table, and
you have an OraclePreparedStatement
object ops
to
insert data into a table. The first column is a string (to designate a row
number), the second column is a BFILE, and you have a valid
oracle.sql.BFILE
object (bfile
). Write the BFILE
to the database as follows:
OraclePreparedStatement ops = (OraclePreparedStatement)conn.prepareStatement ("INSERT INTO my_bfile_table VALUES(?,?)"); ops.setString(1, "one"); ops.setBFILE(2, bfile); ops.execute();
This stores only the locator of the BFILE in the
my_bfile_table
. See the BFILE
class to get more details
about how to deal with the data.
setBFILE
in interface OraclePreparedStatement
setBFILE
in class OraclePreparedStatement
java.sql.SQLException
- if a database access error occurspublic void setBfile(int paramIndex, BFILE x) throws java.sql.SQLException
OraclePreparedStatement
oracle.sql.BFILE
value.
Note: This is the same as setBFILE
.
setBfile
in interface OraclePreparedStatement
setBfile
in class OraclePreparedStatement
java.sql.SQLException
- if a database access error occurspublic void setBytes(int paramIndex, byte[] x) throws java.sql.SQLException
OraclePreparedStatement
setBytes
in interface java.sql.PreparedStatement
setBytes
in class OraclePreparedStatement
x
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setInternalBytes(int paramIndex, byte[] x, int y) throws java.sql.SQLException
setInternalBytes
in interface oracle.jdbc.internal.OraclePreparedStatement
java.sql.SQLException
public void setDate(int paramIndex, java.sql.Date x) throws java.sql.SQLException
OraclePreparedStatement
setDate
in interface java.sql.PreparedStatement
setDate
in class OraclePreparedStatement
x
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setTime(int paramIndex, java.sql.Time x) throws java.sql.SQLException
OraclePreparedStatement
setTime
in interface java.sql.PreparedStatement
setTime
in class OraclePreparedStatement
x
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setTimestamp(int paramIndex, java.sql.Timestamp x) throws java.sql.SQLException
OraclePreparedStatement
setTimestamp
in interface java.sql.PreparedStatement
setTimestamp
in class OraclePreparedStatement
x
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setINTERVALYM(int paramIndex, INTERVALYM x) throws java.sql.SQLException
OraclePreparedStatement
setINTERVALYM
in interface OraclePreparedStatement
setINTERVALYM
in class OraclePreparedStatement
paramIndex
- specifies the parameter index. Index starts from 1.x
- specifies the parameter value.
java.sql.SQLException
- if an error occurred.public void setINTERVALDS(int paramIndex, INTERVALDS x) throws java.sql.SQLException
OraclePreparedStatement
setINTERVALDS
in interface OraclePreparedStatement
setINTERVALDS
in class OraclePreparedStatement
paramIndex
- specifies the parameter index. Index starts from 1.x
- specifies the parameter value.
java.sql.SQLException
- if an error occurred.public void setTIMESTAMP(int paramIndex, TIMESTAMP x) throws java.sql.SQLException
OraclePreparedStatement
setTIMESTAMP
in interface OraclePreparedStatement
setTIMESTAMP
in class OraclePreparedStatement
paramIndex
- specifies the parameter index. Index starts from 1.x
- specifies the parameter value.
java.sql.SQLException
- if an error occurred.public void setTIMESTAMPTZ(int paramIndex, TIMESTAMPTZ x) throws java.sql.SQLException
OraclePreparedStatement
oracle.sql.TIMESTAMPTZ
value.
setTIMESTAMPTZ
in interface OraclePreparedStatement
setTIMESTAMPTZ
in class OraclePreparedStatement
paramIndex
- specifies the parameter index. Index starts from 1.x
- specifies the parameter value.
java.sql.SQLException
- if an error occurred.public void setTIMESTAMPLTZ(int paramIndex, TIMESTAMPLTZ x) throws java.sql.SQLException
OraclePreparedStatement
oracle.sql.TIMESTAMPLTZ
value.
In order to use this method, the calling program must first set the
session time zone of the corresponding connection by using
OracleConnection.setSessionTimeZone()
.
setTIMESTAMPLTZ
in interface OraclePreparedStatement
setTIMESTAMPLTZ
in class OraclePreparedStatement
paramIndex
- specifies the parameter index. Index starts from 1.x
- specifies the parameter value.
java.sql.SQLException
- if an error occurred.public void setAsciiStream(int paramIndex, java.io.InputStream x, int y) throws java.sql.SQLException
OraclePreparedStatement
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
setAsciiStream
in class OraclePreparedStatement
x
- the Java input stream that contains the ASCII parameter valuey
- the number of bytes in the stream
java.sql.SQLException
- if a database access error occurspublic void setBinaryStream(int paramIndex, java.io.InputStream x, int y) throws java.sql.SQLException
OraclePreparedStatement
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
setBinaryStream
in class OraclePreparedStatement
x
- the java input stream which contains the binary parameter valuey
- the number of bytes in the stream
java.sql.SQLException
- if a database access error occurspublic void setUnicodeStream(int paramIndex, java.io.InputStream x, int y) throws java.sql.SQLException
OraclePreparedStatement
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
setUnicodeStream
in class OraclePreparedStatement
x
- the java input stream which contains the
UNICODE parameter valuey
- the number of bytes in the stream
java.sql.SQLException
- if a database access error occurspublic void setCustomDatum(int paramIndex, CustomDatum x) throws java.sql.SQLException
OraclePreparedStatement
oracle.sql.CustomDatum
value.
In the 9i release the oracle.sql.CustomDatum
has been
deprecated and replaced by the oracle.sql.ORAData
interface. For this reason, this method is also deprecated. It is
recommended to use setORAData()
instead.
setCustomDatum
in interface OraclePreparedStatement
setCustomDatum
in class OraclePreparedStatement
x
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setORAData(int paramIndex, ORAData x) throws java.sql.SQLException
OraclePreparedStatement
oracle.sql.ORAData
value.
setORAData
in interface OraclePreparedStatement
setORAData
in class OraclePreparedStatement
x
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setObject(int paramIndex, java.lang.Object x, int y, int z) throws java.sql.SQLException
OraclePreparedStatement
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
setObject
in class OraclePreparedStatement
x
- the object containing the input parameter valuey
- the SQL type (as defined in java.sql.Types
or OracleTypes) to be sent to the database.z
- for numeric types. Ignored for other types.
java.sql.SQLException
- if a database access error occursTypes
public void setObject(int paramIndex, java.lang.Object x, int y) throws java.sql.SQLException
OraclePreparedStatement
setObject
in interface java.sql.PreparedStatement
setObject
in class OraclePreparedStatement
x
- the object containing the input parameter valuey
- 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 setRefType(int paramIndex, REF x) throws java.sql.SQLException
OraclePreparedStatement
oracle.sql.REF
value.
Note: This is the same as setREF
.
setRefType
in interface OraclePreparedStatement
setRefType
in class OraclePreparedStatement
java.sql.SQLException
- if a database access error occurspublic void setRef(int paramIndex, java.sql.Ref x) throws java.sql.SQLException
OraclePreparedStatement
setRef
in interface java.sql.PreparedStatement
setRef
in class OraclePreparedStatement
java.sql.SQLException
- if a database access error occurspublic void setREF(int paramIndex, REF x) throws java.sql.SQLException
OraclePreparedStatement
oracle.sql.REF
value.
setREF
in interface OraclePreparedStatement
setREF
in class OraclePreparedStatement
java.sql.SQLException
- if a database access error occurspublic void setObject(int paramIndex, java.lang.Object x) throws java.sql.SQLException
OraclePreparedStatement
setObject
in interface java.sql.PreparedStatement
setObject
in class OraclePreparedStatement
x
- the object containing the input parameter value
java.sql.SQLException
- if a database access error occurspublic void setOracleObject(int paramIndex, Datum x) throws java.sql.SQLException
OraclePreparedStatement
oracle.sql.Datum
value.
This is a generic setXXX()
method for binding
oracle.sql.
data into a prepared statement as an
oracle.sql.Datum
object.
setOracleObject
in interface OraclePreparedStatement
setOracleObject
in class OraclePreparedStatement
x
- the parameter value
java.sql.SQLException
- if a database access error occurspublic void setCharacterStream(int paramIndex, java.io.Reader x, int y) throws java.sql.SQLException
OraclePreparedStatement
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
setCharacterStream
in class OraclePreparedStatement
x
- the java reader which contains the UNICODE datay
- 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 y) throws java.sql.SQLException
OraclePreparedStatement
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
setDate
in class OraclePreparedStatement
java.sql.SQLException
public void setTime(int paramIndex, java.sql.Time x, java.util.Calendar y) throws java.sql.SQLException
OraclePreparedStatement
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
setTime
in class OraclePreparedStatement
java.sql.SQLException
public void setTimestamp(int paramIndex, java.sql.Timestamp x, java.util.Calendar y) throws java.sql.SQLException
OraclePreparedStatement
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
setTimestamp
in class OraclePreparedStatement
java.sql.SQLException
public void setURL(int paramIndex, java.net.URL x) throws java.sql.SQLException
OraclePreparedStatement
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
setURL
in class OraclePreparedStatement
x
- the java.net.URL
object to be set
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
OraclePreparedStatement
setPlsqlIndexTable
in interface OraclePreparedStatement
setPlsqlIndexTable
in class 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 occurs
|
Oracle10g JDBC | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |