AutoCloseable
, CallableStatement
, OraclePreparedStatement
, OracleStatement
, PreparedStatement
, Statement
, Wrapper
public interface OracleCallableStatement extends CallableStatement, OraclePreparedStatement
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:@<hoststring>", "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
FORM_CHAR, FORM_NCHAR
EXPLICIT, IMPLICIT, NEW
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO
Modifier and Type | Method | Description |
---|---|---|
Object |
getAnyDataEmbeddedObject(int parameterIndex) |
Deprecated.
As of Oracle 11R1 there is full support for ANYTYPE and ANYDATA.
|
ARRAY |
getARRAY(int parameterIndex) |
Retrieves data into an
oracle.sql.ARRAY object. |
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. |
InputStream |
getBinaryStream(int parameterIndex) |
Retrieves data into an
java.io.InputStream object. |
InputStream |
getBinaryStream(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. |
Reader |
getCharacterStream(int parameterIndex) |
Retrieves data into an
java.io.Reader object. |
CLOB |
getCLOB(int parameterIndex) |
Retrieves data into an
oracle.sql.CLOB object. |
ResultSet |
getCursor(int parameterIndex) |
Retrieves data into an
java.sql.ResultSet object. |
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. |
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) |
Deprecated.
since 18.1 Use java.sql.CallableStatement.getObject(int parameterIndex) method.
|
Object |
getORAData(int parameterIndex, ORADataFactory factory) |
|
Object |
getPlsqlIndexTable(int paramIndex) |
Deprecated.
since 18.1.
|
Object |
getPlsqlIndexTable(int paramIndex, Class primitiveType) |
Deprecated.
since 18.1.
|
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. |
InputStream |
getUnicodeStream(int parameterIndex) |
Retrieves data into an
java.io.InputStream object. |
InputStream |
getUnicodeStream(String parameterName) |
Retrieves data into an
java.io.InputStream object. |
void |
registerIndexTableOutParameter(int paramIndex, int maxLen, int elemSqlType, int elemMaxLen) |
Deprecated.
since 18.1.
|
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(String parameterName, int sqlType, int scale, int maxLength) |
Special Oracle version of registerOutParameter for registering CHAR, VARCHAR, LONG, RAW and LONG RAW columns.
|
void |
registerOutParameterAtName(String parameterMarkerName, int sqlType) |
Special Oracle method to registerOutParameter by the parameterMarkerName of oracle style parameter markers instead of parameterIndex.
|
void |
registerOutParameterAtName(String parameterMarkerName, int sqlType, int scale) |
Special Oracle method to registerOutParameter by the parameterMarkerName of oracle style parameter markers instead of parameterIndex.
|
void |
registerOutParameterAtName(String parameterMarkerName, int sqlType, String typeName) |
Special Oracle method to registerOutParameter by the parameterMarkerName of oracle style parameter markers instead of parameterIndex.
|
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.
|
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.
|
int |
sendBatch() |
Send the sets of parameters batched (for Oracle-style batching only).
|
void |
setArray(String parameterName, Array x) |
Sets the designated parameter to an
java.sql.Array value. |
void |
setARRAY(String parameterName, ARRAY x) |
Sets the designated parameter to an
oracle.sql.ARRAY value. |
void |
setAsciiStream(String parameterName, InputStream x, int y) |
Sets the designated parameter to the given input stream, which will have the specified number of bytes.
|
void |
setBfile(String parameterName, BFILE x) |
Sets the designated parameter to an
oracle.sql.BFILE value. |
void |
setBFILE(String parameterName, BFILE x) |
Sets the designated parameter to an
oracle.sql.BFILE value. |
void |
setBigDecimal(String parameterName, BigDecimal x) |
Sets the designated parameter to the given
java.math.BigDecimal value. |
void |
setBinaryDouble(String parameterName, double x) |
Sets the designated parameter to the given
oracle.sql.BINARY_FLOAT value. |
void |
setBinaryDouble(String parameterName, BINARY_DOUBLE x) |
Sets the designated parameter to the given
oracle.sql.BINARY_FLOAT value. |
void |
setBinaryFloat(String parameterName, float x) |
Sets the designated parameter to the given Java
float value. |
void |
setBinaryFloat(String parameterName, BINARY_FLOAT x) |
Sets the designated parameter to the given
oracle.sql.BINARY_FLOAT value. |
void |
setBinaryStream(String parameterName, InputStream x, int y) |
Sets the designated parameter to the given input stream, which will have the specified number of bytes.
|
void |
setBlob(String parameterName, Blob x) |
Sets the designated parameter to an
java.sql.Blob value. |
void |
setBLOB(String parameterName, BLOB x) |
Sets the designated parameter to an
oracle.sql.BLOB value. |
void |
setBoolean(String parameterName, boolean x) |
Sets the designated parameter to the given Java
boolean value. |
void |
setByte(String parameterName, byte x) |
Sets the designated parameter to the given Java
byte value. |
void |
setBytes(String parameterName, byte[] x) |
Sets the designated parameter to the given Java array of bytes.
|
void |
setBytesForBlob(String parameterName, byte[] x) |
Sets the designated parameter to the given Java
byte[] value. |
void |
setCHAR(String parameterName, CHAR x) |
Sets the designated parameter to an
oracle.sql.CHAR value. |
void |
setCharacterStream(String parameterName, Reader x, int y) |
Sets the designated parameter to the given
Reader object, which is the given number of characters long. |
void |
setClob(String parameterName, Clob x) |
Sets the designated parameter to an
java.sql.Clob value. |
void |
setCLOB(String parameterName, CLOB x) |
Sets the designated parameter to an
oracle.sql.CLOB value. |
void |
setCursor(String parameterName, ResultSet x) |
Sets the designated parameter to a Java Cursor value.
|
void |
setCustomDatum(String parameterName, CustomDatum x) |
Sets the designated parameter to an
oracle.sql.CustomDatum value. |
void |
setDate(String parameterName, Date x) |
Sets the designated parameter to the given
java.sql.Date value. |
void |
setDate(String parameterName, Date x, Calendar cal) |
Sets the designated parameter to the given
java.sql.Date value, using the given Calendar object. |
void |
setDATE(String parameterName, DATE x) |
Sets the designated parameter to an
oracle.sql.DATE value. |
void |
setDouble(String parameterName, double x) |
Sets the designated parameter to the given Java
double value. |
void |
setExecuteBatch(int nrows) |
Deprecated.
|
void |
setFixedCHAR(String parameterName, String x) |
Sets the designated parameter to a
String See the javadoc for the setFixedChar(int, String) method in OraclePreparedStatement. |
void |
setFloat(String parameterName, float x) |
Sets the designated parameter to the given Java
float value. |
void |
setInt(String parameterName, int x) |
Sets the designated parameter to the given Java
int value. |
void |
setINTERVALDS(String parameterName, INTERVALDS x) |
Sets the designated parameter to an
oracle.sql.INTERVALDS value. |
void |
setINTERVALYM(String parameterName, INTERVALYM x) |
Sets the designated parameter to an
oracle.sql.INTERVALYM value. |
void |
setLong(String parameterName, long x) |
Sets the designated parameter to the given Java
long value. |
void |
setNull(String parameterName, int sqlType) |
Sets the designated parameter to SQL
NULL . |
void |
setNull(String parameterName, int sqlType, String typeName) |
Sets the designated parameter to SQL
NULL . |
void |
setNUMBER(String parameterName, NUMBER x) |
Sets the designated parameter to an
oracle.sql.NUMBER value. |
void |
setObject(String parameterName, Object x) |
Sets the value of the designated parameter with the given object.
|
void |
setObject(String parameterName, Object x, int y) |
Sets the value of the designated parameter with the given object.
|
void |
setObject(String parameterName, Object x, int targetSqlType, int scale) |
Sets the value of the designated parameter with the given object.
|
void |
setOPAQUE(String parameterName, OPAQUE x) |
Sets the designated parameter to an
oracle.sql.OPAQUE value. |
void |
setOracleObject(String parameterName, Datum x) |
Sets the designated parameter to an
oracle.sql.Datum value. |
void |
setORAData(String parameterName, ORAData x) |
Sets the designated parameter to an
oracle.sql.ORAData value. |
void |
setRAW(String parameterName, RAW x) |
Sets the designated parameter to an
oracle.sql.RAW value. |
void |
setRef(String parameterName, Ref x) |
Sets the designated parameter to an
jdbc.sql.Ref value. |
void |
setREF(String parameterName, REF x) |
Sets the designated parameter to an
oracle.sql.REF value. |
void |
setRefType(String parameterName, REF x) |
Sets the designated parameter to an
oracle.sql.REF value. |
void |
setROWID(String parameterName, ROWID x) |
Sets the designated parameter to an
oracle.sql.ROWID value. |
void |
setShort(String parameterName, short x) |
Sets the designated parameter to the given Java
short value. |
void |
setString(String parameterName, String x) |
Sets the designated parameter to the given Java
String value. |
void |
setStringForClob(String parameterName, String x) |
Sets the designated parameter to the given Java
String value. |
void |
setSTRUCT(String parameterName, STRUCT x) |
Sets the designated parameter to an
oracle.sql.STRUCT value. |
void |
setStructDescriptor(String parameterName, StructDescriptor x) |
|
void |
setTime(String parameterName, Time x) |
Sets the designated parameter to the given
java.sql.Time value. |
void |
setTime(String parameterName, Time x, Calendar cal) |
Sets the designated parameter to the given
java.sql.Time value, using the given Calendar object. |
void |
setTimestamp(String parameterName, Timestamp x) |
Sets the designated parameter to the given
java.sql.Timestamp value. |
void |
setTimestamp(String parameterName, Timestamp x, Calendar cal) |
Sets the designated parameter to the given
java.sql.Timestamp value, using the given Calendar object. |
void |
setTIMESTAMP(String parameterName, TIMESTAMP x) |
Sets the designated parameter to an
oracle.sql.TIMESTAMP value. |
void |
setTIMESTAMPLTZ(String parameterName, TIMESTAMPLTZ x) |
Sets the designated parameter to an
oracle.sql.TIMESTAMPLTZ value. |
void |
setTIMESTAMPTZ(String parameterName, TIMESTAMPTZ x) |
Sets the designated parameter to an
oracle.sql.TIMESTAMPTZ value. |
void |
setUnicodeStream(String parameterName, InputStream x, int y) |
Sets the designated parameter to a Java UnicodeStream value.
|
void |
setURL(String parameterName, URL x) |
Sets the designated parameter to the given
java.net.URL object. |
getArray, getArray, getBigDecimal, getBigDecimal, getBigDecimal, getBlob, getBlob, getBoolean, getBoolean, getByte, getByte, getBytes, getBytes, getCharacterStream, getClob, getClob, getDate, getDate, getDate, getDate, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getLong, getLong, getNCharacterStream, getNCharacterStream, getNClob, getNClob, getNString, getNString, getObject, getObject, getObject, getObject, getObject, getObject, getRef, getRef, getRowId, getRowId, getShort, getShort, getSQLXML, getSQLXML, getString, getString, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getURL, getURL, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, setAsciiStream, setAsciiStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setCharacterStream, setCharacterStream, setClob, setClob, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setObject, setObject, setRowId, setSQLXML, wasNull
defineParameterType, defineParameterTypeBytes, defineParameterTypeChars, getExecuteBatch, getReturnResultSet, OracleGetParameterMetaData, registerReturnParameter, registerReturnParameter, registerReturnParameter, setARRAY, setArrayAtName, setARRAYAtName, setAsciiStreamAtName, setAsciiStreamAtName, setAsciiStreamAtName, setBfile, setBFILE, setBfileAtName, setBFILEAtName, setBigDecimalAtName, setBinaryDouble, setBinaryDouble, setBinaryDoubleAtName, setBinaryDoubleAtName, setBinaryFloat, setBinaryFloat, setBinaryFloatAtName, setBinaryFloatAtName, setBinaryStreamAtName, setBinaryStreamAtName, setBinaryStreamAtName, setBLOB, setBlobAtName, setBlobAtName, setBlobAtName, setBLOBAtName, setBooleanAtName, setByteAtName, setBytesAtName, setBytesForBlob, setBytesForBlobAtName, setCHAR, setCharacterStreamAtName, setCharacterStreamAtName, setCHARAtName, setCheckBindTypes, setCLOB, setClobAtName, setClobAtName, setClobAtName, setCLOBAtName, setCursor, setCursorAtName, setCustomDatum, setCustomDatumAtName, setDATE, setDateAtName, setDateAtName, setDATEAtName, setDisableStmtCaching, setDoubleAtName, setFixedCHAR, setFixedCHARAtName, setFloatAtName, setFormOfUse, setIntAtName, setINTERVALDS, setINTERVALDSAtName, setINTERVALYM, setINTERVALYMAtName, setLongAtName, setNCharacterStreamAtName, setNCharacterStreamAtName, setNClobAtName, setNClobAtName, setNClobAtName, setNStringAtName, setNullAtName, setNullAtName, setNUMBER, setNUMBERAtName, setObjectAtName, setObjectAtName, setObjectAtName, setOPAQUE, setOPAQUEAtName, setOracleObject, setOracleObjectAtName, setORAData, setORADataAtName, setPlsqlIndexTable, setRAW, setRAWAtName, setREF, setRefAtName, setREFAtName, setRefType, setRefTypeAtName, setROWID, setRowIdAtName, setROWIDAtName, setShortAtName, setSQLXMLAtName, setStringAtName, setStringForClob, setStringForClobAtName, setSTRUCT, setSTRUCTAtName, setStructDescriptor, setStructDescriptorAtName, setTimeAtName, setTimeAtName, setTIMESTAMP, setTimestampAtName, setTimestampAtName, setTIMESTAMPAtName, setTIMESTAMPLTZ, setTIMESTAMPLTZAtName, setTIMESTAMPTZ, setTIMESTAMPTZAtName, setUnicodeStreamAtName, setURLAtName
clearDefines, closeOnCompletion, closeWithKey, creationState, defineColumnType, defineColumnType, defineColumnType, defineColumnType, defineColumnTypeBytes, defineColumnTypeChars, enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, getLobPrefetchSize, getRegisteredQueryId, getRegisteredTableNames, getRowPrefetch, isNCHAR, isSimpleIdentifier, setDatabaseChangeRegistration, setLobPrefetchSize, setRowPrefetch
addBatch, clearParameters, execute, executeLargeUpdate, executeQuery, executeUpdate, getMetaData, getParameterMetaData, setArray, setAsciiStream, setAsciiStream, setAsciiStream, setBigDecimal, setBinaryStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setClob, setClob, setDate, setDate, setDouble, setFloat, setInt, setLong, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setNull, setNull, setObject, setObject, setObject, setObject, setObject, setRef, setRowId, setShort, setSQLXML, setString, setTime, setTime, setTimestamp, setTimestamp, setUnicodeStream, setURL
addBatch, cancel, clearBatch, clearWarnings, close, execute, execute, execute, execute, executeBatch, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getLargeMaxRows, getLargeUpdateCount, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isPoolable, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout
isWrapperFor, unwrap
ARRAY getARRAY(int parameterIndex) throws SQLException
oracle.sql.ARRAY
object.parameterIndex
- the first parameter is 1, the second is 2, and so onARRAY
SQLException
- if an error occurs (conversion or database-access error)InputStream getAsciiStream(int parameterIndex) throws SQLException
java.io.InputStream
object.parameterIndex
- the first parameter is 1, the second is 2, and so onjava.io.InputStream
SQLException
- if an error occurs (conversion or database-access error)BFILE getBFILE(int parameterIndex) throws SQLException
oracle.sql.BFILE
object.parameterIndex
- the first parameter is 1, the second is 2, and so onoracle.sql.BFILE
SQLException
- if an error occurs (conversion or database-access error)BFILE getBfile(int parameterIndex) throws SQLException
oracle.sql.BFILE
object.parameterIndex
- the first parameter is 1, the second is 2, and so onoracle.sql.BFILE
SQLException
- if an error occurs (conversion or database-access error)InputStream getBinaryStream(int parameterIndex) throws SQLException
java.io.InputStream
object.parameterIndex
- the first parameter is 1, the second is 2, and so onjava.io.InputStream
SQLException
- if an error occurs (conversion or database-access error)InputStream getBinaryStream(String parameterName) throws SQLException
java.io.InputStream
object.parameterName
- the name of the stored procedure formal parameterjava.io.InputStream
SQLException
- if an error occurs (conversion or database-access error)BLOB getBLOB(int parameterIndex) throws SQLException
oracle.sql.BLOB
object.parameterIndex
- the first parameter is 1, the second is 2, and so onoracle.sql.BLOB
SQLException
- if an error occurs (conversion or database-access error)CHAR getCHAR(int parameterIndex) throws SQLException
oracle.sql.CHAR
object.parameterIndex
- the first parameter is 1, the second is 2, and so onoracle.sql.CHAR
SQLException
- if an error occurs (conversion or database-access error)Reader getCharacterStream(int parameterIndex) throws SQLException
java.io.Reader
object.getCharacterStream
in interface CallableStatement
parameterIndex
- the first parameter is 1, the second is 2, and so onjava.io.Reader
SQLException
- if an error occurs (conversion or database-access error)CLOB getCLOB(int parameterIndex) throws SQLException
oracle.sql.CLOB
object.parameterIndex
- the first parameter is 1, the second is 2, and so onoracle.sql.CLOB
SQLException
- if an error occurs (conversion or database-access error)ResultSet getCursor(int parameterIndex) throws SQLException
java.sql.ResultSet
object.parameterIndex
- the first parameter is 1, the second is 2, and so onjava.sql.ResultSet
SQLException
- if an error occurs (conversion or database-access error)Object getCustomDatum(int parameterIndex, CustomDatumFactory factory) throws SQLException
parameterIndex
- the first parameter is 1, the second is 2, and so onfactory
-SQLException
- if an error occurs (conversion or database-access error)Object getORAData(int parameterIndex, ORADataFactory factory) throws SQLException
parameterIndex
- the first parameter is 1, the second is 2, and so onfactory
-SQLException
- if an error occurs (conversion or database-access error)Object getObject(int parameterIndex, OracleDataFactory factory) throws SQLException
OracleData
, which is returned by the factory's "create" methodparameterIndex
- the first parameter is 1, the second is 2, and so onfactory
-SQLException
- if an error occurs (conversion or database-access error)Object getAnyDataEmbeddedObject(int parameterIndex) throws SQLException
parameterIndex
- the first parameter is 1SQLException
- if an error occurs (conversion or database-access error)DATE getDATE(int parameterIndex) throws SQLException
oracle.sql.DATE
object.parameterIndex
- the first parameter is 1, the second is 2, and so onoracle.sql.DATE
SQLException
- if an error occurs (conversion or database-access error)NUMBER getNUMBER(int parameterIndex) throws SQLException
oracle.sql.NUMBER
object.parameterIndex
- the first parameter is 1, the second is 2, and so onoracle.sql.NUMBER
SQLException
- if an error occurs (conversion or database-access error)OPAQUE getOPAQUE(int parameterIndex) throws SQLException
oracle.sql.OPAQUE
object.parameterIndex
- the first parameter is 1, the second is 2, and so onoracle.sql.OPAQUE
SQLException
- if an error occurs (conversion or database-access error)Datum getOracleObject(int parameterIndex) throws SQLException
oracle.sql.Datum
object.parameterIndex
- the first parameter is 1, the second is 2, and so onoracle.sql.Datum
SQLException
- if an error occurs (conversion or database-access error)RAW getRAW(int parameterIndex) throws SQLException
oracle.sql.RAW
object.parameterIndex
- the first parameter is 1, the second is 2, and so onoracle.sql.RAW
SQLException
- if an error occurs (conversion or database-access error)REF getREF(int parameterIndex) throws SQLException
oracle.sql.REF
object.parameterIndex
- the first parameter is 1, the second is 2, and so onoracle.sql.REF
SQLException
- if an error occurs (conversion or database-access error)ROWID getROWID(int parameterIndex) throws SQLException
oracle.sql.ROWID
object.parameterIndex
- the first parameter is 1, the second is 2, and so onoracle.sql.ROWID
SQLException
- if an error occurs (conversion or database-access error)STRUCT getSTRUCT(int parameterIndex) throws SQLException
oracle.sql.STRUCT
object.parameterIndex
- the first parameter is 1, the second is 2, and so onoracle.sql.STRUCT
SQLException
- if an error occurs (conversion or database-access error)INTERVALYM getINTERVALYM(int parameterIndex) throws SQLException
oracle.sql.INTERVALYM
object.parameterIndex
- the first parameter is 1, the second is 2, and so onoracle.sql.INTERVALYM
SQLException
- if an error occurs (conversion or database-access error)INTERVALDS getINTERVALDS(int parameterIndex) throws SQLException
oracle.sql.INTERVALDS
object.parameterIndex
- the first parameter is 1, the second is 2, and so onoracle.sql.INTERVALDS
SQLException
- if an error occurs (conversion or database-access error)TIMESTAMP getTIMESTAMP(int paramIdx) throws SQLException
oracle.sql.TIMESTAMP
object.paramIdx
- the first parameter is 1, the second is 2, and so onoracle.sql.TIMESTAMP
SQLException
- if an error occurs (conversion or database-access error)TIMESTAMPTZ getTIMESTAMPTZ(int paramIdx) throws SQLException
oracle.sql.TIMESTAMPTZ
object.paramIdx
- the first parameter is 1, the second is 2, and so onoracle.sql.TIMESTAMPTZ
SQLException
- if an error occurs (conversion or database-access error)TIMESTAMPLTZ getTIMESTAMPLTZ(int paramIdx) throws SQLException
oracle.sql.TIMESTAMPLTZ
object.paramIdx
- the first parameter is 1, the second is 2, and so onoracle.sql.TIMESTAMPLTZ
SQLException
- if an error occurs (conversion or database-access error)InputStream getUnicodeStream(int parameterIndex) throws SQLException
java.io.InputStream
object.parameterIndex
- the first parameter is 1, the second is 2, and so onjava.io.InputStream
SQLException
- if an error occurs (conversion or database-access error)InputStream getUnicodeStream(String parameterName) throws SQLException
java.io.InputStream
object.parameterName
- the name of the stored procedure formal parameterjava.io.InputStream
SQLException
- if an error occurs (conversion or database-access error)void registerOutParameter(int paramIndex, int sqlType, int scale, int maxLength) throws 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.SQLException
- if an error occurs (conversion or database-access error)void registerOutParameterBytes(int paramIndex, int sqlType, int scale, int maxLength) throws 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.SQLException
- if an error occurs (conversion or database-access error)void registerOutParameterChars(int paramIndex, int sqlType, int scale, int maxLength) throws 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.SQLException
- if an error occurs (conversion or database-access error)int sendBatch() throws SQLException
Oracle-style batching is not supported for a callable statement. This method simply returns the number of valid rows.
sendBatch
in interface OraclePreparedStatement
SQLException
- if an error occurs (conversion or database-access error)void setExecuteBatch(int nrows) throws 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, this is discarded.SQLException
- if an error occurs (conversion or database-access error)getExecuteBatch
, OracleConnection.setDefaultExecuteBatch
@Deprecated Object getPlsqlIndexTable(int paramIndex) throws SQLException
paramIndex
- the first parameter is 1, the second is 2, and so onSQLException
- if a database-access error occurs.SQLException
- if an error occurs (conversion or database-access error)registerIndexTableOutParameter(int, int, int, int)
@Deprecated Object getPlsqlIndexTable(int paramIndex, Class primitiveType) throws SQLException
paramIndex
- the first parameter is 1, the second is 2, and so onprimitiveType
- is a primitive type class. For example,java.lang.Double.TypeSQLException
- if a database-access error occurs.SQLException
- if an error occurs (conversion or database-access error)registerIndexTableOutParameter(int, int, int, int)
@Deprecated Datum[] getOraclePlsqlIndexTable(int paramIndex) throws SQLException
paramIndex
- the first parameter is 1, the second is 2, and so onSQLException
- if a database-access error occurs.SQLException
- if an error occurs (conversion or database-access error)registerIndexTableOutParameter(int, int, int, int)
@Deprecated void registerIndexTableOutParameter(int paramIndex, int maxLen, int elemSqlType, int elemMaxLen) throws SQLException
paramIndex
- the first parameter is 1, the second is 2, and so onmaxLen
- 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.SQLException
- if sqlType is invalid, or an error occurred.void setBinaryFloat(String parameterName, BINARY_FLOAT x) throws SQLException
oracle.sql.BINARY_FLOAT
value.the
- name of the stored procedure formal parameterx
- the parameter valueSQLException
- if a database access error occursCallableStatement.getFloat(int)
void setBinaryDouble(String parameterName, BINARY_DOUBLE x) throws SQLException
oracle.sql.BINARY_FLOAT
value.the
- name of the stored procedure formal parameterx
- the parameter valueSQLException
- if a database access error occursCallableStatement.getDouble(int)
void setStringForClob(String parameterName, String x) throws 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 valueSQLException
- if a database access error occursCallableStatement.getString(int)
void setBytesForBlob(String parameterName, byte[] x) throws 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 valueSQLException
- if a database access error occursCallableStatement.getString(int)
void registerOutParameter(String parameterName, int sqlType, int scale, int maxLength) throws 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.SQLException
- if an error occurs (conversion or database-access error)void setNull(String parameterName, int sqlType, String typeName) throws 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 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
valueSQLException
- if a database access error occursvoid setNull(String parameterName, int sqlType) throws SQLException
NULL
.
Note: You must specify the parameter's SQL type.
setNull
in interface CallableStatement
the
- name of the stored procedure formal parametersqlType
- the SQL type code defined in java.sql.Types
SQLException
- if a database access error occursvoid setBoolean(String parameterName, boolean x) throws SQLException
boolean
value. The driver converts this to an SQL BIT
value when it sends it to the database.setBoolean
in interface CallableStatement
the
- name of the stored procedure formal parameterx
- the parameter valueSQLException
- if a database access error occursCallableStatement.getBoolean(int)
void setByte(String parameterName, byte x) throws SQLException
byte
value. The driver converts this to an SQL TINYINT
value when it sends it to the database.setByte
in interface CallableStatement
the
- name of the stored procedure formal parameterx
- the parameter valueSQLException
- if a database access error occursCallableStatement.getByte(int)
void setShort(String parameterName, short x) throws SQLException
short
value. The driver converts this to an SQL SMALLINT
value when it sends it to the database.setShort
in interface CallableStatement
the
- name of the stored procedure formal parameterx
- the parameter valueSQLException
- if a database access error occursCallableStatement.getShort(int)
void setInt(String parameterName, int x) throws SQLException
int
value. The driver converts this to an SQL INTEGER
value when it sends it to the database.setInt
in interface CallableStatement
the
- name of the stored procedure formal parameterx
- the parameter valueSQLException
- if a database access error occursCallableStatement.getInt(int)
void setLong(String parameterName, long x) throws SQLException
long
value. The driver converts this to an SQL BIGINT
value when it sends it to the database.setLong
in interface CallableStatement
the
- name of the stored procedure formal parameterx
- the parameter valueSQLException
- if a database access error occursCallableStatement.getLong(int)
void setFloat(String parameterName, float x) throws SQLException
float
value. The driver converts this to an SQL FLOAT
value when it sends it to the database.setFloat
in interface CallableStatement
the
- name of the stored procedure formal parameterx
- the parameter valueSQLException
- if a database access error occursCallableStatement.getFloat(int)
void setBinaryFloat(String parameterName, float x) throws 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 valueSQLException
- if a database access error occursCallableStatement.getFloat(int)
void setBinaryDouble(String parameterName, double x) throws SQLException
oracle.sql.BINARY_FLOAT
value.the
- name of the stored procedure formal parameterx
- the parameter valueSQLException
- if a database access error occursCallableStatement.getFloat(int)
void setDouble(String parameterName, double x) throws SQLException
double
value. The driver converts this to an SQL DOUBLE
value when it sends it to the database.setDouble
in interface CallableStatement
the
- name of the stored procedure formal parameterx
- the parameter valueSQLException
- if a database access error occursCallableStatement.getDouble(int)
void setBigDecimal(String parameterName, BigDecimal x) throws SQLException
java.math.BigDecimal
value. The driver converts this to an SQL NUMERIC
value when it sends it to the database.setBigDecimal
in interface CallableStatement
the
- name of the stored procedure formal parameterx
- the parameter valueSQLException
- if a database access error occursCallableStatement.getBigDecimal(int, int)
void setString(String parameterName, String x) throws 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 CallableStatement
the
- name of the stored procedure formal parameterx
- the parameter valueSQLException
- if a database access error occursCallableStatement.getString(int)
void setFixedCHAR(String parameterName, String x) throws 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 valueSQLException
- if a database access error occursvoid setCursor(String parameterName, ResultSet x) throws SQLException
parameterName
- the name of the stored procedure formal parametervalue
- the parameter valueSQLException
- if a database access error occursvoid setROWID(String parameterName, ROWID x) throws SQLException
oracle.sql.ROWID
value.parameterName
- the name of the stored procedure formal parametervalue
- the parameter valueSQLException
- if a database access error occursvoid setRAW(String parameterName, RAW x) throws SQLException
oracle.sql.RAW
value.parameterName
- the name of the stored procedure formal parametervalue
- the parameter valueSQLException
- if a database access error occursvoid setCHAR(String parameterName, CHAR x) throws SQLException
oracle.sql.CHAR
value.parameterName
- the name of the stored procedure formal parametervalue
- the parameter valueSQLException
- if a database access error occursvoid setDATE(String parameterName, DATE x) throws SQLException
oracle.sql.DATE
value.parameterName
- the name of the stored procedure formal parametervalue
- the parameter valueSQLException
- if a database access error occursvoid setNUMBER(String parameterName, NUMBER x) throws SQLException
oracle.sql.NUMBER
value.parameterName
- the name of the stored procedure formal parametervalue
- the parameter valueSQLException
- if a database access error occursvoid setBLOB(String parameterName, BLOB x) throws SQLException
oracle.sql.BLOB
value.parameterName
- the name of the stored procedure formal parametervalue
- the parameter valueSQLException
- if a database access error occursvoid setBlob(String parameterName, Blob x) throws SQLException
java.sql.Blob
value.setBlob
in interface CallableStatement
parameterName
- the name of the stored procedure formal parametervalue
- the parameter valueSQLException
- if a database access error occursvoid setCLOB(String parameterName, CLOB x) throws SQLException
oracle.sql.CLOB
value.parameterName
- the name of the stored procedure formal parametervalue
- the parameter valueSQLException
- if a database access error occursvoid setClob(String parameterName, Clob x) throws SQLException
java.sql.Clob
value.setClob
in interface CallableStatement
parameterName
- the name of the stored procedure formal parametervalue
- the parameter valueSQLException
- if a database access error occursvoid setBFILE(String parameterName, BFILE x) throws SQLException
oracle.sql.BFILE
value.parameterName
- the name of the stored procedure formal parametervalue
- the parameter valueSQLException
- if a database access error occursvoid setBfile(String parameterName, BFILE x) throws SQLException
oracle.sql.BFILE
value.parameterName
- the name of the stored procedure formal parametervalue
- the parameter valueSQLException
- if a database access error occursvoid setBytes(String parameterName, byte[] x) throws 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 CallableStatement
the
- name of the stored procedure formal parameterx
- the parameter valueSQLException
- if a database access error occursCallableStatement.getBytes(int)
void setDate(String parameterName, Date x) throws SQLException
java.sql.Date
value. The driver converts this to an SQL DATE
value when it sends it to the database.setDate
in interface CallableStatement
the
- name of the stored procedure formal parameterx
- the parameter valueSQLException
- if a database access error occursCallableStatement.getDate(int)
void setTime(String parameterName, Time x) throws SQLException
java.sql.Time
value. The driver converts this to an SQL TIME
value when it sends it to the database.setTime
in interface CallableStatement
the
- name of the stored procedure formal parameterx
- the parameter valueSQLException
- if a database access error occursCallableStatement.getTime(int)
void setTimestamp(String parameterName, Timestamp x) throws SQLException
java.sql.Timestamp
value. The driver converts this to an SQL TIMESTAMP
value when it sends it to the database.setTimestamp
in interface CallableStatement
the
- name of the stored procedure formal parameterx
- the parameter valueSQLException
- if a database access error occursCallableStatement.getTimestamp(int)
void setINTERVALYM(String parameterName, INTERVALYM x) throws SQLException
oracle.sql.INTERVALYM
value.parameterName
- the name of the stored procedure formal parametervalue
- the parameter valueSQLException
- if a database access error occursvoid setINTERVALDS(String parameterName, INTERVALDS x) throws SQLException
oracle.sql.INTERVALDS
value.parameterName
- the name of the stored procedure formal parametervalue
- the parameter valueSQLException
- if a database access error occursvoid setTIMESTAMP(String parameterName, TIMESTAMP x) throws SQLException
oracle.sql.TIMESTAMP
value.parameterName
- the name of the stored procedure formal parametervalue
- the parameter valueSQLException
- if a database access error occursvoid setTIMESTAMPTZ(String parameterName, TIMESTAMPTZ x) throws SQLException
oracle.sql.TIMESTAMPTZ
value.parameterName
- the name of the stored procedure formal parametervalue
- the parameter valueSQLException
- if a database access error occursvoid setTIMESTAMPLTZ(String parameterName, TIMESTAMPLTZ x) throws SQLException
oracle.sql.TIMESTAMPLTZ
value.parameterName
- the name of the stored procedure formal parametervalue
- the parameter valueSQLException
- if a database access error occursvoid setAsciiStream(String parameterName, InputStream x, int y) throws 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 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 streamSQLException
- if a database access error occursvoid setBinaryStream(String parameterName, InputStream x, int y) throws 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 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 streamSQLException
- if a database access error occursvoid setUnicodeStream(String parameterName, InputStream x, int y) throws 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 streamSQLException
- if a database access error occursvoid setCharacterStream(String parameterName, Reader x, int y) throws 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 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 streamSQLException
- if a database access error occursvoid setDate(String parameterName, Date x, Calendar cal) throws 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 CallableStatement
the
- name of the stored procedure formal parameterx
- the parameter valuecal
- the Calendar
object the driver will use to construct the dateSQLException
- if a database access error occursCallableStatement.getDate(int)
void setTime(String parameterName, Time x, Calendar cal) throws 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 CallableStatement
the
- name of the stored procedure formal parameterx
- the parameter valuecal
- the Calendar
object the driver will use to construct the timeSQLException
- if a database access error occursCallableStatement.getTime(int)
void setTimestamp(String parameterName, Timestamp x, Calendar cal) throws 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 CallableStatement
the
- name of the stored procedure formal parameterx
- the parameter valuecal
- the Calendar
object the driver will use to construct the timestampSQLException
- if a database access error occursCallableStatement.getTimestamp(int)
void setURL(String parameterName, URL x) throws SQLException
java.net.URL
object. The driver converts this to an SQL DATALINK
value when it sends it to the database.setURL
in interface CallableStatement
the
- name of the stored procedure formal parameterval
- the parameter valueSQLException
- if a database access error occurs, or if a URL is malformedCallableStatement.getURL(int)
void setArray(String parameterName, Array x) throws SQLException
java.sql.Array
value.parameterName
- the name of the stored procedure formal parametervalue
- the parameter valueSQLException
- if a database access error occursvoid setARRAY(String parameterName, ARRAY x) throws SQLException
oracle.sql.ARRAY
value.parameterName
- the name of the stored procedure formal parametervalue
- the parameter valueSQLException
- if a database access error occursvoid setOPAQUE(String parameterName, OPAQUE x) throws SQLException
oracle.sql.OPAQUE
value.parameterName
- the name of the stored procedure formal parametervalue
- the parameter valueSQLException
- if a database access error occursvoid setStructDescriptor(String parameterName, StructDescriptor x) throws SQLException
SQLException
void setSTRUCT(String parameterName, STRUCT x) throws SQLException
oracle.sql.STRUCT
value.parameterName
- the name of the stored procedure formal parametervalue
- the parameter valueSQLException
- if a database access error occursvoid setCustomDatum(String parameterName, CustomDatum x) throws SQLException
oracle.sql.CustomDatum
value.parameterName
- the name of the stored procedure formal parametervalue
- the parameter valueSQLException
- if a database access error occursvoid setORAData(String parameterName, ORAData x) throws SQLException
oracle.sql.ORAData
value.parameterName
- the name of the stored procedure formal parametervalue
- the parameter valueSQLException
- if a database access error occursvoid setObject(String parameterName, Object x, int targetSqlType, int scale) throws 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 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.SQLException
- if a database access error occursTypes
, getObject(int, oracle.jdbc.OracleDataFactory)
void setObject(String parameterName, Object x, int y) throws SQLException
setObject
above, except that it assumes a scale of zero.setObject
in interface 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 databaseSQLException
- if a database access error occursgetObject(int, oracle.jdbc.OracleDataFactory)
void setRefType(String parameterName, REF x) throws SQLException
oracle.sql.REF
value.parameterName
- the name of the stored procedure formal parametervalue
- the parameter valueSQLException
- if a database access error occursvoid setRef(String parameterName, Ref x) throws SQLException
jdbc.sql.Ref
value.parameterName
- the name of the stored procedure formal parametervalue
- the parameter valueSQLException
- if a database access error occursvoid setREF(String parameterName, REF x) throws SQLException
oracle.sql.REF
value.parameterName
- the name of the stored procedure formal parametervalue
- the parameter valueSQLException
- if a database access error occursvoid setObject(String parameterName, Object x) throws 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 CallableStatement
the
- name of the stored procedure formal parameterx
- the object containing the input parameter valueSQLException
- if a database access error occurs or if the given Object
parameter is ambiguousgetObject(int, oracle.jdbc.OracleDataFactory)
void setOracleObject(String parameterName, Datum x) throws SQLException
oracle.sql.Datum
value.the
- name of the stored procedure formal parametervalue
- the parameter valueSQLException
- if a database access error occursvoid registerOutParameterAtName(String parameterMarkerName, int sqlType) throws SQLException
parameterMarkerName
- The name of the oracle style parameter markersqlType
- a value from Types
SQLException
void registerOutParameterAtName(String parameterMarkerName, int sqlType, int scale) throws SQLException
parameterMarkerName
- The name of the oracle style parameter markersqlType
- a value from Types
scale
- the desired number of digits to the right of the decimal point. It must be greater than or equal to zero.SQLException
void registerOutParameterAtName(String parameterMarkerName, int sqlType, String typeName) throws SQLException
parameterMarkerName
- The name of the oracle style parameter markersqlType
- a value from Types
typeName
- the fully-qualified name of an SQL structured typeSQLException