|
Oracle JDBC API Reference 11g Release 2 ("11.2.0.3.0") |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface OracleCallableStatement
This interface extends the OraclePreparedStatement
(which
extends the OracleStatement
interface) and incorporates standard
JDBC callable statement functionality. It is used to execute SQL stored
procedure.
Oracle JDBC drivers support execution of PL/SQL stored procedures and anonymous blocks. They support both SQL92 escape syntax and Oracle PL/SQL block syntax. The following PL/SQL calls would work with any Oracle JDBC driver:
// SQL92 syntax CallableStatement cs1 = conn.prepareCall ( "{call proc (?,?)}" ) ; // stored proc CallableStatement cs2 = conn.prepareCall ( "{? = call func (?,?)}" ) ; // stored func // Oracle PL/SQL block syntax CallableStatement cs3 = conn.prepareCall ( "begin proc (?,?); end;" ) ; // stored proc CallableStatement cs4 = conn.prepareCall ( "begin ? := func(?,?); end;" ) ; // stored func
As an example of using Oracle syntax, here is a PL/SQL code snippet that creates a stored function. The PL/SQL function gets a character sequence and concatenates a suffix to it:
create or replace function foo (val1 char) return char as begin return val1 || 'suffix'; end;
Your invocation call in your JDBC program should look like:
Connection conn = DriverManager.getConnection ("jdbc:oracle:oci8:@", "scott", "tiger"); CallableStatement cs = conn.prepareCall ("begin ? := foo(?); end;"); cs.registerOutParameter(1,Types.CHAR); cs.setString(2, "aa"); cs.executeUpdate(); String result = cs.getString(1);
Connection.prepareCall
Field Summary |
---|
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 java.sql.Statement |
---|
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO |
Fields inherited from interface oracle.jdbc.OracleStatement |
---|
EXPLICIT, IMPLICIT, NEW |
Fields inherited from interface java.sql.Statement |
---|
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO |
Method Summary | |
---|---|
java.lang.Object |
getAnyDataEmbeddedObject(int parameterIndex)
Deprecated. As of Oracle 11R1 there is full support for ANYTYPE and ANYDATA. Please use oracle.sql.ANYDATA for new code and plan on replacing any use of this method by the next major release. Note that in 11R1 this method is reimplemnted using the ANYDATA support and will now also function in all the drivers, not just oci. In the previous implementation it was possible to call registerOutParameter with a sqlType of either oracle.jdbc.OracleTypes.OPAQUE or oracle.jdbc.OracleTypes.STRUCT The new implemention requires the correct type which is OPAQUE. |
ARRAY |
getARRAY(int parameterIndex)
Retrieves data into an oracle.sql.ARRAY object. |
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. |
BFILE |
getBFILE(int parameterIndex)
Retrieves data into an oracle.sql.BFILE object. |
java.io.InputStream |
getBinaryStream(int parameterIndex)
Retrieves data into an java.io.InputStream object. |
java.io.InputStream |
getBinaryStream(java.lang.String parameterName)
Retrieves data into an java.io.InputStream object. |
BLOB |
getBLOB(int parameterIndex)
Retrieves data into an oracle.sql.BLOB object. |
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. |
CLOB |
getCLOB(int parameterIndex)
Retrieves data into an oracle.sql.CLOB object. |
java.sql.ResultSet |
getCursor(int parameterIndex)
Retrieves data into an java.sql.ResultSet object. |
java.lang.Object |
getCustomDatum(int parameterIndex,
CustomDatumFactory factory)
Deprecated. |
DATE |
getDATE(int parameterIndex)
Retrieves data into an oracle.sql.DATE object. |
INTERVALDS |
getINTERVALDS(int parameterIndex)
Retrieves data into an oracle.sql.INTERVALDS object. |
INTERVALYM |
getINTERVALYM(int parameterIndex)
Retrieves data into an oracle.sql.INTERVALYM object. |
NUMBER |
getNUMBER(int parameterIndex)
Retrieves data into an oracle.sql.NUMBER object. |
java.lang.Object |
getObject(int parameterIndex,
OracleDataFactory factory)
Returns an instance of OracleData , which is returned by the factory's
"create" method |
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 paramIndex)
Oracle OCI driver specific. |
java.lang.Object |
getORAData(int parameterIndex,
ORADataFactory factory)
|
java.lang.Object |
getPlsqlIndexTable(int paramIndex)
Get the value of a PLSQL index table parameter as a Java array. |
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. |
REF |
getREF(int parameterIndex)
Retrieves data into an oracle.sql.REF object. |
ROWID |
getROWID(int parameterIndex)
Retrieves data into an oracle.sql.ROWID object. |
STRUCT |
getSTRUCT(int parameterIndex)
Retrieves data into an oracle.sql.STRUCT object. |
TIMESTAMP |
getTIMESTAMP(int paramIdx)
Retrieves data into an oracle.sql.TIMESTAMP object. |
TIMESTAMPLTZ |
getTIMESTAMPLTZ(int paramIdx)
Retrieves data into an oracle.sql.TIMESTAMPLTZ object. |
TIMESTAMPTZ |
getTIMESTAMPTZ(int paramIdx)
Retrieves data into an oracle.sql.TIMESTAMPTZ object. |
java.io.InputStream |
getUnicodeStream(int parameterIndex)
Retrieves data into an java.io.InputStream object. |
java.io.InputStream |
getUnicodeStream(java.lang.String parameterName)
Retrieves data into an java.io.InputStream object. |
void |
registerIndexTableOutParameter(int paramIndex,
int maxLen,
int elemSqlType,
int elemMaxLen)
Oracle OCI driver specific. |
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(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 |
registerOutParameterBytes(int paramIndex,
int sqlType,
int scale,
int maxLength)
Deprecated. As of Oracle 10g Release 1 all character values are measured in Java chars so this method is no longer supported. It now is the equivalent of calling registerOutParameter with the same args. Since the number of bytes is at least as large as the number of characters this will always work although it may waste memory. Use registerOutParameter with the number of Java chars instead. |
void |
registerOutParameterChars(int paramIndex,
int sqlType,
int scale,
int maxLength)
Deprecated. As of Oracle 10g Release 1 all character values are measured in Java chars so this method is no longer needed. Call registerOutParameter with the same args instead. |
int |
sendBatch()
Send the sets of parameters batched (for Oracle-style batching only). |
void |
setArray(java.lang.String parameterName,
java.sql.Array x)
Sets the designated parameter to an java.sql.Array value. |
void |
setARRAY(java.lang.String parameterName,
ARRAY x)
Sets the designated parameter to an oracle.sql.ARRAY value. |
void |
setAsciiStream(java.lang.String parameterName,
java.io.InputStream x,
int y)
Sets the designated parameter to the given input stream, which will have the specified number of bytes. |
void |
setBfile(java.lang.String parameterName,
BFILE x)
Sets the designated parameter to an oracle.sql.BFILE value. |
void |
setBFILE(java.lang.String parameterName,
BFILE x)
Sets the designated parameter to an oracle.sql.BFILE value. |
void |
setBigDecimal(java.lang.String parameterName,
java.math.BigDecimal x)
Sets the designated parameter to the given java.math.BigDecimal 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 oracle.sql.BINARY_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(java.lang.String parameterName,
java.io.InputStream x,
int y)
Sets the designated parameter to the given input stream, which will have the specified number of bytes. |
void |
setBlob(java.lang.String parameterName,
java.sql.Blob x)
Sets the designated parameter to an java.sql.Blob value. |
void |
setBLOB(java.lang.String parameterName,
BLOB x)
Sets the designated parameter to an oracle.sql.BLOB value. |
void |
setBoolean(java.lang.String parameterName,
boolean x)
Sets the designated parameter to the given Java boolean value. |
void |
setByte(java.lang.String parameterName,
byte x)
Sets the designated parameter to the given Java byte value. |
void |
setBytes(java.lang.String parameterName,
byte[] x)
Sets the designated parameter to the given Java array of bytes. |
void |
setBytesForBlob(java.lang.String parameterName,
byte[] x)
Sets the designated parameter to the given Java byte[] value. |
void |
setCHAR(java.lang.String parameterName,
CHAR x)
Sets the designated parameter to an oracle.sql.CHAR value. |
void |
setCharacterStream(java.lang.String parameterName,
java.io.Reader x,
int y)
Sets the designated parameter to the given Reader
object, which is the given number of characters long. |
void |
setClob(java.lang.String parameterName,
java.sql.Clob x)
Sets the designated parameter to an java.sql.Clob value. |
void |
setCLOB(java.lang.String parameterName,
CLOB x)
Sets the designated parameter to an oracle.sql.CLOB value. |
void |
setCursor(java.lang.String parameterName,
java.sql.ResultSet x)
Sets the designated parameter to a Java Cursor value. |
void |
setCustomDatum(java.lang.String parameterName,
CustomDatum x)
Sets the designated parameter to an oracle.sql.CustomDatum value. |
void |
setDate(java.lang.String parameterName,
java.sql.Date x)
Sets the designated parameter to the given java.sql.Date value. |
void |
setDATE(java.lang.String parameterName,
DATE x)
Sets the designated parameter to an oracle.sql.DATE value. |
void |
setDate(java.lang.String parameterName,
java.sql.Date x,
java.util.Calendar cal)
Sets the designated parameter to the given java.sql.Date value,
using the given Calendar object. |
void |
setDouble(java.lang.String parameterName,
double x)
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(java.lang.String parameterName,
java.lang.String x)
Sets the designated parameter to a String
See the javadoc for the setFixedChar(int, String) method
in OraclePreparedStatement. |
void |
setFloat(java.lang.String parameterName,
float x)
Sets the designated parameter to the given Java float value. |
void |
setInt(java.lang.String parameterName,
int x)
Sets the designated parameter to the given Java int value. |
void |
setINTERVALDS(java.lang.String parameterName,
INTERVALDS x)
Sets the designated parameter to an oracle.sql.INTERVALDS value. |
void |
setINTERVALYM(java.lang.String parameterName,
INTERVALYM x)
Sets the designated parameter to an oracle.sql.INTERVALYM value. |
void |
setLong(java.lang.String parameterName,
long x)
Sets the designated parameter to the given Java long value. |
void |
setNull(java.lang.String parameterName,
int sqlType)
Sets the designated parameter to SQL NULL . |
void |
setNull(java.lang.String parameterName,
int sqlType,
java.lang.String typeName)
Sets the designated parameter to SQL NULL . |
void |
setNUMBER(java.lang.String parameterName,
NUMBER x)
Sets the designated parameter to an oracle.sql.NUMBER value. |
void |
setObject(java.lang.String parameterName,
java.lang.Object x)
Sets the value of the designated parameter with the given object. |
void |
setObject(java.lang.String parameterName,
java.lang.Object x,
int y)
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)
Sets the value of the designated parameter with the given object. |
void |
setOPAQUE(java.lang.String parameterName,
OPAQUE x)
Sets the designated parameter to an oracle.sql.OPAQUE value. |
void |
setOracleObject(java.lang.String parameterName,
Datum x)
Sets the designated parameter to an oracle.sql.Datum value. |
void |
setORAData(java.lang.String parameterName,
ORAData x)
Sets the designated parameter to an oracle.sql.ORAData value. |
void |
setRAW(java.lang.String parameterName,
RAW x)
Sets the designated parameter to an oracle.sql.RAW value. |
void |
setRef(java.lang.String parameterName,
java.sql.Ref x)
Sets the designated parameter to an jdbc.sql.Ref value. |
void |
setREF(java.lang.String parameterName,
REF x)
Sets the designated parameter to an oracle.sql.REF value. |
void |
setRefType(java.lang.String parameterName,
REF x)
Sets the designated parameter to an oracle.sql.REF value. |
void |
setROWID(java.lang.String parameterName,
ROWID x)
Sets the designated parameter to an oracle.sql.ROWID value. |
void |
setShort(java.lang.String parameterName,
short x)
Sets the designated parameter to the given Java short value. |
void |
setString(java.lang.String parameterName,
java.lang.String x)
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(java.lang.String parameterName,
STRUCT x)
Sets the designated parameter to an oracle.sql.STRUCT value. |
void |
setStructDescriptor(java.lang.String parameterName,
StructDescriptor x)
|
void |
setTime(java.lang.String parameterName,
java.sql.Time x)
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)
Sets the designated parameter to the given java.sql.Time value,
using the given Calendar object. |
void |
setTimestamp(java.lang.String parameterName,
java.sql.Timestamp x)
Sets the designated parameter to the given java.sql.Timestamp value. |
void |
setTIMESTAMP(java.lang.String parameterName,
TIMESTAMP x)
Sets the designated parameter to an oracle.sql.TIMESTAMP value. |
void |
setTimestamp(java.lang.String parameterName,
java.sql.Timestamp x,
java.util.Calendar cal)
Sets the designated parameter to the given java.sql.Timestamp value,
using the given Calendar object. |
void |
setTIMESTAMPLTZ(java.lang.String parameterName,
TIMESTAMPLTZ x)
Sets the designated parameter to an oracle.sql.TIMESTAMPLTZ value. |
void |
setTIMESTAMPTZ(java.lang.String parameterName,
TIMESTAMPTZ x)
Sets the designated parameter to an oracle.sql.TIMESTAMPTZ value. |
void |
setUnicodeStream(java.lang.String parameterName,
java.io.InputStream x,
int y)
Sets the designated parameter to a Java UnicodeStream value. |
void |
setURL(java.lang.String parameterName,
java.net.URL x)
Sets the designated parameter to the given java.net.URL object. |
Methods inherited from interface java.sql.CallableStatement |
---|
getArray, getArray, getBigDecimal, getBigDecimal, getBigDecimal, getBlob, getBlob, getBoolean, getBoolean, getByte, getByte, getBytes, getBytes, getClob, getClob, getDate, getDate, getDate, getDate, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getLong, getLong, getObject, getObject, getObject, getObject, getRef, getRef, getShort, getShort, getString, getString, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getURL, getURL, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, wasNull |
Methods inherited from interface java.sql.PreparedStatement |
---|
addBatch, clearParameters, execute, executeQuery, executeUpdate, getMetaData, getParameterMetaData, setArray, setAsciiStream, setBigDecimal, setBinaryStream, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setClob, setDate, setDate, setDouble, setFloat, setInt, setLong, setNull, setNull, setObject, setObject, setObject, setRef, setShort, setString, setTime, setTime, setTimestamp, setTimestamp, setUnicodeStream, setURL |
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 java.sql.PreparedStatement |
---|
addBatch, clearParameters, execute, executeQuery, executeUpdate, getMetaData, getParameterMetaData, setArray, setAsciiStream, setBigDecimal, setBinaryStream, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setClob, setDate, setDate, setDouble, setFloat, setInt, setLong, setNull, setNull, setObject, setObject, setObject, setRef, setShort, setString, setTime, setTime, setTimestamp, setTimestamp, setUnicodeStream, setURL |
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, getLobPrefetchSize, getRegisteredQueryId, getRegisteredTableNames, getRowPrefetch, isNCHAR, setDatabaseChangeRegistration, setLobPrefetchSize, setResultSetCache, setRowPrefetch |
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 |
Method Detail |
---|
ARRAY getARRAY(int parameterIndex) throws java.sql.SQLException
oracle.sql.ARRAY
object.
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)java.io.InputStream getAsciiStream(int parameterIndex) throws java.sql.SQLException
java.io.InputStream
object.
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)BFILE getBFILE(int parameterIndex) throws java.sql.SQLException
oracle.sql.BFILE
object.
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)BFILE getBfile(int parameterIndex) throws java.sql.SQLException
oracle.sql.BFILE
object.
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)java.io.InputStream getBinaryStream(int parameterIndex) throws java.sql.SQLException
java.io.InputStream
object.
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)java.io.InputStream getBinaryStream(java.lang.String parameterName) throws java.sql.SQLException
java.io.InputStream
object.
parameterName
- the name of the stored procedure formal parameter
java.io.InputStream
java.sql.SQLException
- if an error occurs (conversion or database-access error)BLOB getBLOB(int parameterIndex) throws java.sql.SQLException
oracle.sql.BLOB
object.
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)CHAR getCHAR(int parameterIndex) throws java.sql.SQLException
oracle.sql.CHAR
object.
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)java.io.Reader getCharacterStream(int parameterIndex) throws java.sql.SQLException
java.io.Reader
object.
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)CLOB getCLOB(int parameterIndex) throws java.sql.SQLException
oracle.sql.CLOB
object.
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)java.sql.ResultSet getCursor(int parameterIndex) throws java.sql.SQLException
java.sql.ResultSet
object.
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)java.lang.Object getCustomDatum(int parameterIndex, CustomDatumFactory factory) throws java.sql.SQLException
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)java.lang.Object getORAData(int parameterIndex, ORADataFactory factory) throws java.sql.SQLException
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)java.lang.Object getObject(int parameterIndex, OracleDataFactory factory) throws java.sql.SQLException
OracleData
, which is returned by the factory's
"create" method
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)java.lang.Object getAnyDataEmbeddedObject(int parameterIndex) throws java.sql.SQLException
parameterIndex
- the first parameter is 1
java.sql.SQLException
- if an error occurs (conversion or database-access
error)DATE getDATE(int parameterIndex) throws java.sql.SQLException
oracle.sql.DATE
object.
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)NUMBER getNUMBER(int parameterIndex) throws java.sql.SQLException
oracle.sql.NUMBER
object.
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)OPAQUE getOPAQUE(int parameterIndex) throws java.sql.SQLException
oracle.sql.OPAQUE
object.
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)Datum getOracleObject(int parameterIndex) throws java.sql.SQLException
oracle.sql.Datum
object.
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)RAW getRAW(int parameterIndex) throws java.sql.SQLException
oracle.sql.RAW
object.
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)REF getREF(int parameterIndex) throws java.sql.SQLException
oracle.sql.REF
object.
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)ROWID getROWID(int parameterIndex) throws java.sql.SQLException
oracle.sql.ROWID
object.
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)STRUCT getSTRUCT(int parameterIndex) throws java.sql.SQLException
oracle.sql.STRUCT
object.
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)INTERVALYM getINTERVALYM(int parameterIndex) throws java.sql.SQLException
oracle.sql.INTERVALYM
object.
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)INTERVALDS getINTERVALDS(int parameterIndex) throws java.sql.SQLException
oracle.sql.INTERVALDS
object.
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)TIMESTAMP getTIMESTAMP(int paramIdx) throws java.sql.SQLException
oracle.sql.TIMESTAMP
object.
paramIdx
- 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)TIMESTAMPTZ getTIMESTAMPTZ(int paramIdx) throws java.sql.SQLException
oracle.sql.TIMESTAMPTZ
object.
paramIdx
- 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)TIMESTAMPLTZ getTIMESTAMPLTZ(int paramIdx) throws java.sql.SQLException
oracle.sql.TIMESTAMPLTZ
object.
paramIdx
- 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)java.io.InputStream getUnicodeStream(int parameterIndex) throws java.sql.SQLException
java.io.InputStream
object.
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)java.io.InputStream getUnicodeStream(java.lang.String parameterName) throws java.sql.SQLException
java.io.InputStream
object.
parameterName
- the name of the stored procedure formal parameter
java.io.InputStream
java.sql.SQLException
- if an error occurs (conversion or database-access error)void registerOutParameter(int paramIndex, int sqlType, int scale, int maxLength) throws java.sql.SQLException
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)void registerOutParameterBytes(int paramIndex, int sqlType, int scale, int maxLength) throws java.sql.SQLException
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)void registerOutParameterChars(int paramIndex, int sqlType, int scale, int maxLength) throws java.sql.SQLException
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)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 OraclePreparedStatement
java.sql.SQLException
- if an error occurs (conversion or database-access error)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 OraclePreparedStatement
nrows
- batch value to be set. It must be greater than or
equal to 1.
java.sql.SQLException
- if an error occurs (conversion or database-access error)getExecuteBatch
,
OracleConnection.setDefaultExecuteBatch
java.lang.Object getPlsqlIndexTable(int paramIndex) throws java.sql.SQLException
paramIndex
- the first parameter is 1, the second is 2, and so on
java.sql.SQLException
- if a database-access error occurs.
java.sql.SQLException
- if an error occurs (conversion or database-access error)java.lang.Object getPlsqlIndexTable(int paramIndex, java.lang.Class primitiveType) throws java.sql.SQLException
paramIndex
- the first parameter is 1, the second is 2, and so onprimitiveType
- is a primitive type class.
For example,java.lang.Double.Type
java.sql.SQLException
- if a database-access error occurs.
java.sql.SQLException
- if an error occurs (conversion or database-access error)Datum[] getOraclePlsqlIndexTable(int paramIndex) throws java.sql.SQLException
paramIndex
- the first parameter is 1, the second is 2, and so on
java.sql.SQLException
- if a database-access error occurs.
java.sql.SQLException
- if an error occurs (conversion or database-access error)void registerIndexTableOutParameter(int paramIndex, int maxLen, int elemSqlType, int elemMaxLen) throws java.sql.SQLException
paramIndex
- the first parameter is 1, the second is 2, and so onmaxLen
- 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 sqlType is invalid, or an error occurred.void setBinaryFloat(java.lang.String parameterName, BINARY_FLOAT x) throws java.sql.SQLException
oracle.sql.BINARY_FLOAT
value.
the
- name of the stored procedure formal parameterx
- the parameter value
java.sql.SQLException
- if a database access error occursCallableStatement.getFloat(int)
void setBinaryDouble(java.lang.String parameterName, BINARY_DOUBLE x) throws java.sql.SQLException
oracle.sql.BINARY_FLOAT
value.
the
- name of the stored procedure formal parameterx
- the parameter value
java.sql.SQLException
- if a database access error occursCallableStatement.getDouble(int)
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
.
This is wrong.
the
- name of the stored procedure formal parameterx
- the parameter value
java.sql.SQLException
- if a database access error occursCallableStatement.getString(int)
void setBytesForBlob(java.lang.String parameterName, byte[] x) throws java.sql.SQLException
byte[]
value.
The driver converts this
to an SQL BINARY
or LONGBINARY CHECK THIS
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 byte array is larger than
32765 it is converted to a temporary blob and that is sent
to the database.
This blob conversion produces data truncation for columns of type
BINARY
..
the
- name of the stored procedure formal parameterx
- the parameter value
java.sql.SQLException
- if a database access error occursCallableStatement.getString(int)
void registerOutParameter(java.lang.String parameterName, int sqlType, int scale, int maxLength) throws java.sql.SQLException
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)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
the
- name of the stored procedure formal parametersqlType
- 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 occursvoid 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
the
- name of the stored procedure formal parametersqlType
- the SQL type code defined in java.sql.Types
java.sql.SQLException
- if a database access error occursvoid 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
the
- name of the stored procedure formal parameterx
- the parameter value
java.sql.SQLException
- if a database access error occursCallableStatement.getBoolean(int)
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
the
- name of the stored procedure formal parameterx
- the parameter value
java.sql.SQLException
- if a database access error occursCallableStatement.getByte(int)
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
the
- name of the stored procedure formal parameterx
- the parameter value
java.sql.SQLException
- if a database access error occursCallableStatement.getShort(int)
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
the
- name of the stored procedure formal parameterx
- the parameter value
java.sql.SQLException
- if a database access error occursCallableStatement.getInt(int)
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
the
- name of the stored procedure formal parameterx
- the parameter value
java.sql.SQLException
- if a database access error occursCallableStatement.getLong(int)
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
the
- name of the stored procedure formal parameterx
- the parameter value
java.sql.SQLException
- if a database access error occursCallableStatement.getFloat(int)
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.
the
- name of the stored procedure formal parameterx
- the parameter value
java.sql.SQLException
- if a database access error occursCallableStatement.getFloat(int)
void setBinaryDouble(java.lang.String parameterName, double x) throws java.sql.SQLException
oracle.sql.BINARY_FLOAT
value.
the
- name of the stored procedure formal parameterx
- the parameter value
java.sql.SQLException
- if a database access error occursCallableStatement.getFloat(int)
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
the
- name of the stored procedure formal parameterx
- the parameter value
java.sql.SQLException
- if a database access error occursCallableStatement.getDouble(int)
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
the
- name of the stored procedure formal parameterx
- the parameter value
java.sql.SQLException
- if a database access error occursCallableStatement.getBigDecimal(int, int)
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
the
- name of the stored procedure formal parameterx
- the parameter value
java.sql.SQLException
- if a database access error occursCallableStatement.getString(int)
void setFixedCHAR(java.lang.String parameterName, java.lang.String x) throws java.sql.SQLException
String
See the javadoc for the setFixedChar(int, String) method
in OraclePreparedStatement. Note that PL/SQL
comparison operators do provide blank padding.
parameterName
- the name of the stored procedure formal parameterx
- the parameter value
java.sql.SQLException
- if a database access error occursvoid setCursor(java.lang.String parameterName, java.sql.ResultSet x) throws java.sql.SQLException
parameterName
- the name of the stored procedure formal parametervalue
- the parameter value
java.sql.SQLException
- if a database access error occursvoid setROWID(java.lang.String parameterName, ROWID x) throws java.sql.SQLException
oracle.sql.ROWID
value.
parameterName
- the name of the stored procedure formal parametervalue
- the parameter value
java.sql.SQLException
- if a database access error occursvoid setRAW(java.lang.String parameterName, RAW x) throws java.sql.SQLException
oracle.sql.RAW
value.
parameterName
- the name of the stored procedure formal parametervalue
- the parameter value
java.sql.SQLException
- if a database access error occursvoid setCHAR(java.lang.String parameterName, CHAR x) throws java.sql.SQLException
oracle.sql.CHAR
value.
parameterName
- the name of the stored procedure formal parametervalue
- the parameter value
java.sql.SQLException
- if a database access error occursvoid setDATE(java.lang.String parameterName, DATE x) throws java.sql.SQLException
oracle.sql.DATE
value.
parameterName
- the name of the stored procedure formal parametervalue
- the parameter value
java.sql.SQLException
- if a database access error occursvoid setNUMBER(java.lang.String parameterName, NUMBER x) throws java.sql.SQLException
oracle.sql.NUMBER
value.
parameterName
- the name of the stored procedure formal parametervalue
- the parameter value
java.sql.SQLException
- if a database access error occursvoid setBLOB(java.lang.String parameterName, BLOB x) throws java.sql.SQLException
oracle.sql.BLOB
value.
parameterName
- the name of the stored procedure formal parametervalue
- the parameter value
java.sql.SQLException
- if a database access error occursvoid setBlob(java.lang.String parameterName, java.sql.Blob x) throws java.sql.SQLException
java.sql.Blob
value.
parameterName
- the name of the stored procedure formal parametervalue
- the parameter value
java.sql.SQLException
- if a database access error occursvoid setCLOB(java.lang.String parameterName, CLOB x) throws java.sql.SQLException
oracle.sql.CLOB
value.
parameterName
- the name of the stored procedure formal parametervalue
- the parameter value
java.sql.SQLException
- if a database access error occursvoid setClob(java.lang.String parameterName, java.sql.Clob x) throws java.sql.SQLException
java.sql.Clob
value.
parameterName
- the name of the stored procedure formal parametervalue
- the parameter value
java.sql.SQLException
- if a database access error occursvoid setBFILE(java.lang.String parameterName, BFILE x) throws java.sql.SQLException
oracle.sql.BFILE
value.
parameterName
- the name of the stored procedure formal parametervalue
- the parameter value
java.sql.SQLException
- if a database access error occursvoid setBfile(java.lang.String parameterName, BFILE x) throws java.sql.SQLException
oracle.sql.BFILE
value.
parameterName
- the name of the stored procedure formal parametervalue
- the parameter value
java.sql.SQLException
- if a database access error occursvoid 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
the
- name of the stored procedure formal parameterx
- the parameter value
java.sql.SQLException
- if a database access error occursCallableStatement.getBytes(int)
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
the
- name of the stored procedure formal parameterx
- the parameter value
java.sql.SQLException
- if a database access error occursCallableStatement.getDate(int)
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
the
- name of the stored procedure formal parameterx
- the parameter value
java.sql.SQLException
- if a database access error occursCallableStatement.getTime(int)
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
the
- name of the stored procedure formal parameterx
- the parameter value
java.sql.SQLException
- if a database access error occursCallableStatement.getTimestamp(int)
void setINTERVALYM(java.lang.String parameterName, INTERVALYM x) throws java.sql.SQLException
oracle.sql.INTERVALYM
value.
parameterName
- the name of the stored procedure formal parametervalue
- the parameter value
java.sql.SQLException
- if a database access error occursvoid setINTERVALDS(java.lang.String parameterName, INTERVALDS x) throws java.sql.SQLException
oracle.sql.INTERVALDS
value.
parameterName
- the name of the stored procedure formal parametervalue
- the parameter value
java.sql.SQLException
- if a database access error occursvoid setTIMESTAMP(java.lang.String parameterName, TIMESTAMP x) throws java.sql.SQLException
oracle.sql.TIMESTAMP
value.
parameterName
- the name of the stored procedure formal parametervalue
- the parameter value
java.sql.SQLException
- if a database access error occursvoid setTIMESTAMPTZ(java.lang.String parameterName, TIMESTAMPTZ x) throws java.sql.SQLException
oracle.sql.TIMESTAMPTZ
value.
parameterName
- the name of the stored procedure formal parametervalue
- the parameter value
java.sql.SQLException
- if a database access error occursvoid setTIMESTAMPLTZ(java.lang.String parameterName, TIMESTAMPLTZ x) throws java.sql.SQLException
oracle.sql.TIMESTAMPLTZ
value.
parameterName
- the name of the stored procedure formal parametervalue
- the parameter value
java.sql.SQLException
- if a database access error occursvoid setAsciiStream(java.lang.String parameterName, java.io.InputStream x, int y) 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 stored procedure formal 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 occursvoid setBinaryStream(java.lang.String parameterName, java.io.InputStream x, int y) 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 stored procedure formal 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 occursvoid setUnicodeStream(java.lang.String parameterName, java.io.InputStream x, int y) throws java.sql.SQLException
parameterName
- the name of the stored procedure formal 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 occursvoid setCharacterStream(java.lang.String parameterName, java.io.Reader x, int y) 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
the
- name of the stored procedure formal 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 occursvoid 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 time zone. If no
Calendar
object is specified, the driver uses the default
time zone, which is that of the virtual machine running the application.
setDate
in interface java.sql.CallableStatement
the
- name of the stored procedure formal parameterx
- the parameter valuecal
- the Calendar
object the driver will use
to construct the date
java.sql.SQLException
- if a database access error occursCallableStatement.getDate(int)
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 time zone. If no
Calendar
object is specified, the driver uses the default
time zone, which is that of the virtual machine running the application.
setTime
in interface java.sql.CallableStatement
the
- name of the stored procedure formal parameterx
- the parameter valuecal
- the Calendar
object the driver will use
to construct the time
java.sql.SQLException
- if a database access error occursCallableStatement.getTime(int)
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 time zone. If no
Calendar
object is specified, the driver uses the default
time zone, which is that of the virtual machine running the application.
setTimestamp
in interface java.sql.CallableStatement
the
- name of the stored procedure formal parameterx
- the parameter valuecal
- the Calendar
object the driver will use
to construct the timestamp
java.sql.SQLException
- if a database access error occursCallableStatement.getTimestamp(int)
void setURL(java.lang.String parameterName, java.net.URL x) 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
the
- name of the stored procedure formal parameterval
- the parameter value
java.sql.SQLException
- if a database access error occurs,
or if a URL is malformedCallableStatement.getURL(int)
void setArray(java.lang.String parameterName, java.sql.Array x) throws java.sql.SQLException
java.sql.Array
value.
parameterName
- the name of the stored procedure formal parametervalue
- the parameter value
java.sql.SQLException
- if a database access error occursvoid setARRAY(java.lang.String parameterName, ARRAY x) throws java.sql.SQLException
oracle.sql.ARRAY
value.
parameterName
- the name of the stored procedure formal parametervalue
- the parameter value
java.sql.SQLException
- if a database access error occursvoid setOPAQUE(java.lang.String parameterName, OPAQUE x) throws java.sql.SQLException
oracle.sql.OPAQUE
value.
parameterName
- the name of the stored procedure formal parametervalue
- the parameter value
java.sql.SQLException
- if a database access error occursvoid setStructDescriptor(java.lang.String parameterName, StructDescriptor x) throws java.sql.SQLException
java.sql.SQLException
void setSTRUCT(java.lang.String parameterName, STRUCT x) throws java.sql.SQLException
oracle.sql.STRUCT
value.
parameterName
- the name of the stored procedure formal parametervalue
- the parameter value
java.sql.SQLException
- if a database access error occursvoid setCustomDatum(java.lang.String parameterName, CustomDatum x) throws java.sql.SQLException
oracle.sql.CustomDatum
value.
parameterName
- the name of the stored procedure formal parametervalue
- the parameter value
java.sql.SQLException
- if a database access error occursvoid setORAData(java.lang.String parameterName, ORAData x) throws java.sql.SQLException
oracle.sql.ORAData
value.
parameterName
- the name of the stored procedure formal parametervalue
- the parameter value
java.sql.SQLException
- if a database access error occursvoid 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 database- specific abstract data types.
setObject
in interface java.sql.CallableStatement
the
- name of the stored procedure formal 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, oracle.jdbc.OracleDataFactory)
void setObject(java.lang.String parameterName, java.lang.Object x, int y) throws java.sql.SQLException
setObject
above, except that it assumes a scale of zero.
setObject
in interface java.sql.CallableStatement
the
- name of the stored procedure formal 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, oracle.jdbc.OracleDataFactory)
void setRefType(java.lang.String parameterName, REF x) throws java.sql.SQLException
oracle.sql.REF
value.
parameterName
- the name of the stored procedure formal parametervalue
- the parameter value
java.sql.SQLException
- if a database access error occursvoid setRef(java.lang.String parameterName, java.sql.Ref x) throws java.sql.SQLException
jdbc.sql.Ref
value.
parameterName
- the name of the stored procedure formal parametervalue
- the parameter value
java.sql.SQLException
- if a database access error occursvoid setREF(java.lang.String parameterName, REF x) throws java.sql.SQLException
oracle.sql.REF
value.
parameterName
- the name of the stored procedure formal parametervalue
- the parameter value
java.sql.SQLException
- if a database access error occursvoid 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 database-
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
the
- name of the stored procedure formal 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, oracle.jdbc.OracleDataFactory)
void setOracleObject(java.lang.String parameterName, Datum x) throws java.sql.SQLException
oracle.sql.Datum
value.
the
- name of the stored procedure formal parametervalue
- the parameter value
java.sql.SQLException
- if a database access error occurs
|
Oracle JDBC API Reference 11g Release 2 ("11.2.0.3.0") |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |