Skip navigation links

Oracle® Database JDBC Java API Reference
11g Release 2

E13995-02


oracle.jdbc
Interface OracleCallableStatement

All Superinterfaces:
java.sql.CallableStatement, OraclePreparedStatement, OracleStatement, java.sql.PreparedStatement, java.sql.Statement, java.sql.Wrapper

public interface OracleCallableStatement
extends java.sql.CallableStatement, OraclePreparedStatement

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:@<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);
  
Since:
8.1.7
See Also:
Connection.prepareCall

Field Summary

 

Fields inherited from interface oracle.jdbc.OraclePreparedStatement
FORM_CHAR, FORM_NCHAR

 

Fields inherited from interface oracle.jdbc.OracleStatement
EXPLICIT, IMPLICIT, NEW

 

Fields inherited from interface 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.
 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)
           
 void setARRAY(java.lang.String parameterName, ARRAY x)
           
 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)
           
 void setBFILE(java.lang.String parameterName, BFILE x)
           
 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)
           
 void setBLOB(java.lang.String parameterName, BLOB x)
           
 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)
           
 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)
           
 void setCLOB(java.lang.String parameterName, CLOB x)
           
 void setCursor(java.lang.String parameterName, java.sql.ResultSet x)
           
 void setCustomDatum(java.lang.String parameterName, CustomDatum x)
           
 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)
           
 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)
           
 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)
           
 void setINTERVALYM(java.lang.String parameterName, INTERVALYM x)
           
 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)
           
 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)
           
 void setOracleObject(java.lang.String parameterName, Datum x)
           
 void setORAData(java.lang.String parameterName, ORAData x)
           
 void setRAW(java.lang.String parameterName, RAW x)
           
 void setRef(java.lang.String parameterName, java.sql.Ref x)
           
 void setREF(java.lang.String parameterName, REF x)
           
 void setRefType(java.lang.String parameterName, REF x)
           
 void setROWID(java.lang.String parameterName, ROWID x)
           
 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)
           
 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)
           
 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)
           
 void setTIMESTAMPTZ(java.lang.String parameterName, TIMESTAMPTZ x)
           
 void setUnicodeStream(java.lang.String parameterName, java.io.InputStream x, int y)
           
 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, 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, 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, setAsciiStream, setAsciiStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setCharacterStream, setCharacterStream, setClob, setClob, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setRowId, setSQLXML, wasNull

 

Methods inherited from interface oracle.jdbc.OraclePreparedStatement
defineParameterType, defineParameterTypeBytes, defineParameterTypeChars, getExecuteBatch, getReturnResultSet, OracleGetParameterMetaData, registerReturnParameter, registerReturnParameter, registerReturnParameter, setARRAY, setArrayAtName, setARRAYAtName, setAsciiStreamAtName, setBfile, setBFILE, setBfileAtName, setBFILEAtName, setBigDecimalAtName, setBinaryDouble, setBinaryDouble, setBinaryDoubleAtName, setBinaryDoubleAtName, setBinaryFloat, setBinaryFloat, setBinaryFloatAtName, setBinaryFloatAtName, setBinaryStreamAtName, setBLOB, setBlobAtName, setBLOBAtName, setBooleanAtName, setByteAtName, setBytesAtName, setBytesForBlob, setBytesForBlobAtName, setCHAR, setCHARAtName, setCheckBindTypes, setCLOB, setClobAtName, setCLOBAtName, setCursor, setCursorAtName, setCustomDatum, setCustomDatumAtName, setDATE, setDateAtName, setDATEAtName, setDateAtName, setDisableStmtCaching, setDoubleAtName, setFixedCHAR, setFixedCHARAtName, setFloatAtName, setFormOfUse, setIntAtName, setINTERVALDS, setINTERVALDSAtName, setINTERVALYM, setINTERVALYMAtName, setLongAtName, setNullAtName, setNullAtName, setNUMBER, setNUMBERAtName, setObjectAtName, setObjectAtName, setObjectAtName, setOPAQUE, setOPAQUEAtName, setOracleObject, setOracleObjectAtName, setORAData, setORADataAtName, setPlsqlIndexTable, setRAW, setRAWAtName, setREF, setRefAtName, setREFAtName, setRefType, setRefTypeAtName, setROWID, setROWIDAtName, setShortAtName, setStringAtName, setStringForClob, setStringForClobAtName, setSTRUCT, setSTRUCTAtName, setStructDescriptor, setStructDescriptorAtName, setTimeAtName, setTimeAtName, setTIMESTAMP, setTimestampAtName, setTIMESTAMPAtName, setTimestampAtName, setTIMESTAMPLTZ, setTIMESTAMPLTZAtName, setTIMESTAMPTZ, setTIMESTAMPTZAtName, setUnicodeStreamAtName, setURLAtName

 

Methods inherited from interface java.sql.PreparedStatement
addBatch, clearParameters, execute, 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, setRef, setRowId, setShort, setSQLXML, setString, setTime, setTime, setTimestamp, setTimestamp, setUnicodeStream, setURL

 

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, isClosed, isPoolable, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout

 

Methods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap

 

Method Detail

getARRAY

ARRAY getARRAY(int parameterIndex)
               throws java.sql.SQLException
Retrieves data into an oracle.sql.ARRAY object.
Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
Returns:
data into an ARRAY
Throws:
java.sql.SQLException - if an error occurs (conversion or database-access error)

getAsciiStream

java.io.InputStream getAsciiStream(int parameterIndex)
                                   throws java.sql.SQLException
Retrieves data into an java.io.InputStream object.
Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
Returns:
data into an java.io.InputStream
Throws:
java.sql.SQLException - if an error occurs (conversion or database-access error)

getBFILE

BFILE getBFILE(int parameterIndex)
               throws java.sql.SQLException
Retrieves data into an oracle.sql.BFILE object.
Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
Returns:
data into an oracle.sql.BFILE
Throws:
java.sql.SQLException - if an error occurs (conversion or database-access error)

getBfile

BFILE getBfile(int parameterIndex)
               throws java.sql.SQLException
Retrieves data into an oracle.sql.BFILE object.
Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
Returns:
data into an oracle.sql.BFILE
Throws:
java.sql.SQLException - if an error occurs (conversion or database-access error)

getBinaryStream

java.io.InputStream getBinaryStream(int parameterIndex)
                                    throws java.sql.SQLException
Retrieves data into an java.io.InputStream object.
Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
Returns:
data into an java.io.InputStream
Throws:
java.sql.SQLException - if an error occurs (conversion or database-access error)

getBinaryStream

java.io.InputStream getBinaryStream(java.lang.String parameterName)
                                    throws java.sql.SQLException
Retrieves data into an java.io.InputStream object.
Parameters:
parameterName - the name of the stored procedure formal parameter
Returns:
data into an java.io.InputStream
Throws:
java.sql.SQLException - if an error occurs (conversion or database-access error)

getBLOB

BLOB getBLOB(int parameterIndex)
             throws java.sql.SQLException
Retrieves data into an oracle.sql.BLOB object.
Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
Returns:
data into an oracle.sql.BLOB
Throws:
java.sql.SQLException - if an error occurs (conversion or database-access error)

getCHAR

CHAR getCHAR(int parameterIndex)
             throws java.sql.SQLException
Retrieves data into an oracle.sql.CHAR object.
Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
Returns:
data into an oracle.sql.CHAR
Throws:
java.sql.SQLException - if an error occurs (conversion or database-access error)

getCharacterStream

java.io.Reader getCharacterStream(int parameterIndex)
                                  throws java.sql.SQLException
Retrieves data into an java.io.Reader object.
Specified by:
getCharacterStream in interface java.sql.CallableStatement
Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
Returns:
data into an java.io.Reader
Throws:
java.sql.SQLException - if an error occurs (conversion or database-access error)

getCLOB

CLOB getCLOB(int parameterIndex)
             throws java.sql.SQLException
Retrieves data into an oracle.sql.CLOB object.
Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
Returns:
data into an oracle.sql.CLOB
Throws:
java.sql.SQLException - if an error occurs (conversion or database-access error)

getCursor

java.sql.ResultSet getCursor(int parameterIndex)
                             throws java.sql.SQLException
Retrieves data into an java.sql.ResultSet object.
Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
Returns:
data into an java.sql.ResultSet
Throws:
java.sql.SQLException - if an error occurs (conversion or database-access error)

getCustomDatum

java.lang.Object getCustomDatum(int parameterIndex,
                                CustomDatumFactory factory)
                                throws java.sql.SQLException
Deprecated. 
Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
factory -
Returns:
Throws:
java.sql.SQLException - if an error occurs (conversion or database-access error)

getORAData

java.lang.Object getORAData(int parameterIndex,
                            ORADataFactory factory)
                            throws java.sql.SQLException
Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
factory -
Returns:
Throws:
java.sql.SQLException - if an error occurs (conversion or database-access error)

getAnyDataEmbeddedObject

java.lang.Object getAnyDataEmbeddedObject(int parameterIndex)
                                          throws java.sql.SQLException
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.
Retrieves data of an embedded object within AnyData
Parameters:
parameterIndex - the first parameter is 1
Returns:
data depending on the embedded type in AnyData
Throws:
java.sql.SQLException - if an error occurs (conversion or database-access error)

getDATE

DATE getDATE(int parameterIndex)
             throws java.sql.SQLException
Retrieves data into an oracle.sql.DATE object.
Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
Returns:
data into an oracle.sql.DATE
Throws:
java.sql.SQLException - if an error occurs (conversion or database-access error)

getNUMBER

NUMBER getNUMBER(int parameterIndex)
                 throws java.sql.SQLException
Retrieves data into an oracle.sql.NUMBER object.
Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
Returns:
data into an oracle.sql.NUMBER
Throws:
java.sql.SQLException - if an error occurs (conversion or database-access error)

getOPAQUE

OPAQUE getOPAQUE(int parameterIndex)
                 throws java.sql.SQLException
Retrieves data into an oracle.sql.OPAQUE object.
Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
Returns:
data into an oracle.sql.OPAQUE
Throws:
java.sql.SQLException - if an error occurs (conversion or database-access error)

getOracleObject

Datum getOracleObject(int parameterIndex)
                      throws java.sql.SQLException
Retrieves data into an oracle.sql.Datum object.
Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
Returns:
data into an oracle.sql.Datum
Throws:
java.sql.SQLException - if an error occurs (conversion or database-access error)

getRAW

RAW getRAW(int parameterIndex)
           throws java.sql.SQLException
Retrieves data into an oracle.sql.RAW object.
Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
Returns:
data into an oracle.sql.RAW
Throws:
java.sql.SQLException - if an error occurs (conversion or database-access error)

getREF

REF getREF(int parameterIndex)
           throws java.sql.SQLException
Retrieves data into an oracle.sql.REF object.
Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
Returns:
data into an oracle.sql.REF
Throws:
java.sql.SQLException - if an error occurs (conversion or database-access error)

getROWID

ROWID getROWID(int parameterIndex)
               throws java.sql.SQLException
Retrieves data into an oracle.sql.ROWID object.
Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
Returns:
data into an oracle.sql.ROWID
Throws:
java.sql.SQLException - if an error occurs (conversion or database-access error)

getSTRUCT

STRUCT getSTRUCT(int parameterIndex)
                 throws java.sql.SQLException
Retrieves data into an oracle.sql.STRUCT object.
Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
Returns:
data into an oracle.sql.STRUCT
Throws:
java.sql.SQLException - if an error occurs (conversion or database-access error)

getINTERVALYM

INTERVALYM getINTERVALYM(int parameterIndex)
                         throws java.sql.SQLException
Retrieves data into an oracle.sql.INTERVALYM object.
Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
Returns:
data into an oracle.sql.INTERVALYM
Throws:
java.sql.SQLException - if an error occurs (conversion or database-access error)
Since:
9i

getINTERVALDS

INTERVALDS getINTERVALDS(int parameterIndex)
                         throws java.sql.SQLException
Retrieves data into an oracle.sql.INTERVALDS object.
Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
Returns:
data into an oracle.sql.INTERVALDS
Throws:
java.sql.SQLException - if an error occurs (conversion or database-access error)
Since:
10i

getTIMESTAMP

TIMESTAMP getTIMESTAMP(int paramIdx)
                       throws java.sql.SQLException
Retrieves data into an oracle.sql.TIMESTAMP object.
Parameters:
paramIdx - the first parameter is 1, the second is 2, and so on
Returns:
data into an oracle.sql.TIMESTAMP
Throws:
java.sql.SQLException - if an error occurs (conversion or database-access error)
Since:
9i

getTIMESTAMPTZ

TIMESTAMPTZ getTIMESTAMPTZ(int paramIdx)
                           throws java.sql.SQLException
Retrieves data into an oracle.sql.TIMESTAMPTZ object.
Parameters:
paramIdx - the first parameter is 1, the second is 2, and so on
Returns:
data into an oracle.sql.TIMESTAMPTZ
Throws:
java.sql.SQLException - if an error occurs (conversion or database-access error)
Since:
9i

getTIMESTAMPLTZ

TIMESTAMPLTZ getTIMESTAMPLTZ(int paramIdx)
                             throws java.sql.SQLException
Retrieves data into an oracle.sql.TIMESTAMPLTZ object.
Parameters:
paramIdx - the first parameter is 1, the second is 2, and so on
Returns:
data into an oracle.sql.TIMESTAMPLTZ
Throws:
java.sql.SQLException - if an error occurs (conversion or database-access error)
Since:
9i

getUnicodeStream

java.io.InputStream getUnicodeStream(int parameterIndex)
                                     throws java.sql.SQLException
Retrieves data into an java.io.InputStream object.
Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
Returns:
data into an java.io.InputStream
Throws:
java.sql.SQLException - if an error occurs (conversion or database-access error)

getUnicodeStream

java.io.InputStream getUnicodeStream(java.lang.String parameterName)
                                     throws java.sql.SQLException
Retrieves data into an java.io.InputStream object.
Parameters:
parameterName - the name of the stored procedure formal parameter
Returns:
data into an java.io.InputStream
Throws:
java.sql.SQLException - if an error occurs (conversion or database-access error)

registerOutParameter

void registerOutParameter(int paramIndex,
                          int sqlType,
                          int scale,
                          int maxLength)
                          throws java.sql.SQLException
Special Oracle version of registerOutParameter for registering CHAR, VARCHAR, LONG, RAW and LONG RAW columns. Depending on the value of OracleConnection.getDataSizeUnits(), maxLength will be measured in bytes or characters.
Parameters:
paramIndex - parameter index (the first parameter is 1).
sqlType - type of the bind parameter
scale - not used
maxLength - maximum length of the column, specified in bytes or characters.
Throws:
java.sql.SQLException - if an error occurs (conversion or database-access error)

registerOutParameterBytes

void registerOutParameterBytes(int paramIndex,
                               int sqlType,
                               int scale,
                               int maxLength)
                               throws java.sql.SQLException
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.
Special Oracle version of registerOutParameter for registering CHAR, VARCHAR, LONG, RAW and LONG RAW columns. This version accepts a maxLength parameter measured in bytes.
Parameters:
paramIndex - parameter index (the first parameter is 1).
sqlType - type of the bind parameter
scale - not used
maxLength - maximum length of the column, specified in bytes. If not specified, maximum length allowed for that type is used.
Throws:
java.sql.SQLException - if an error occurs (conversion or database-access error)

registerOutParameterChars

void registerOutParameterChars(int paramIndex,
                               int sqlType,
                               int scale,
                               int maxLength)
                               throws java.sql.SQLException
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.
Special Oracle version of registerOutParameter for registering CHAR, VARCHAR, LONG, RAW and LONG RAW columns. This version accepts a maxLength parameter measured in characters.
Parameters:
paramIndex - parameter index (the first parameter is 1).
sqlType - type of the bind parameter
scale - not used
maxLength - maximum length of the column, specified in characters. If not specified, maximum length allowed for that type is used.
Throws:
java.sql.SQLException - if an error occurs (conversion or database-access error)

sendBatch

int sendBatch()
              throws java.sql.SQLException
Send the sets of parameters batched (for Oracle-style batching only).

Oracle-style batching is not supported for a callable statement. This method simply returns the number of valid rows.

Specified by:
sendBatch in interface OraclePreparedStatement
Returns:
the update count.
Throws:
java.sql.SQLException - if an error occurs (conversion or database-access error)

setExecuteBatch

void setExecuteBatch(int nrows)
                     throws java.sql.SQLException
Set the batch value (for Oracle-style batching only).

Oracle-style batching is not supported for a callable statement. This method always sets the batch value to 1.

Specified by:
setExecuteBatch in interface OraclePreparedStatement
Parameters:
nrows - batch value to be set. It must be greater than or equal to 1.
Throws:
java.sql.SQLException - if an error occurs (conversion or database-access error)
See Also:
getExecuteBatch, OracleConnection.setDefaultExecuteBatch

getPlsqlIndexTable

java.lang.Object getPlsqlIndexTable(int paramIndex)
                                    throws java.sql.SQLException
Get the value of a PLSQL index table parameter as a Java array. The type of the Java arry will be the default Java object type corresponding to the element's SQL type, following the mapping for built-in types specified in the JDBC spec.
Parameters:
paramIndex - the first parameter is 1, the second is 2, and so on
Returns:
A java.lang.Object holding the parameter value.
Throws:
java.sql.SQLException - if a database-access error occurs.
java.sql.SQLException - if an error occurs (conversion or database-access error)

getPlsqlIndexTable

java.lang.Object getPlsqlIndexTable(int paramIndex,
                                    java.lang.Class primitiveType)
                                    throws java.sql.SQLException
Oracle OCI driver specific. Get the value of a PLSQL index table parameter as a primitive array. 'primitiveType' speicifies the return array type.
Parameters:
paramIndex - the first parameter is 1, the second is 2, and so on
primitiveType - is a primitive type class. For example,java.lang.Double.Type
Returns:
A java.lang.Object holding the parameter value.
Throws:
java.sql.SQLException - if a database-access error occurs.
java.sql.SQLException - if an error occurs (conversion or database-access error)

getOraclePlsqlIndexTable

Datum[] getOraclePlsqlIndexTable(int paramIndex)
                                 throws java.sql.SQLException
Oracle OCI driver specific. Get the value of a PLSQL index table parameter as a oracle.sql.Datum array.
Parameters:
paramIndex - the first parameter is 1, the second is 2, and so on
Returns:
A Datum array holding the parameter value.
Throws:
java.sql.SQLException - if a database-access error occurs.
java.sql.SQLException - if an error occurs (conversion or database-access error)

registerIndexTableOutParameter

void registerIndexTableOutParameter(int paramIndex,
                                    int maxLen,
                                    int elemSqlType,
                                    int elemMaxLen)
                                    throws java.sql.SQLException
Oracle OCI driver specific. Special Oracle version of registerOutParameter for registering PLSQL index table parameter.
Parameters:
paramIndex - the first parameter is 1, the second is 2, and so on
maxLen - the maximum possible number of elements.
curLen - the current 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.
Throws:
java.sql.SQLException - if sqlType is invalid, or an error occurred.
Since:
8.1.7

setBinaryFloat

void setBinaryFloat(java.lang.String parameterName,
                    BINARY_FLOAT x)
                    throws java.sql.SQLException
Sets the designated parameter to the given oracle.sql.BINARY_FLOAT value.
Parameters:
parameterName - the name of the parameter
x - the parameter value
Throws:
java.sql.SQLException - if a database access error occurs
Since:
10.0
See Also:
CallableStatement.getFloat(int)

setBinaryDouble

void setBinaryDouble(java.lang.String parameterName,
                     BINARY_DOUBLE x)
                     throws java.sql.SQLException
Sets the designated parameter to the given oracle.sql.BINARY_FLOAT value.
Parameters:
parameterName - the name of the parameter
x - the parameter value
Throws:
java.sql.SQLException - if a database access error occurs
Since:
10.0
See Also:
CallableStatement.getDouble(int)

setStringForClob

void setStringForClob(java.lang.String parameterName,
                      java.lang.String x)
                      throws java.sql.SQLException
Sets the designated parameter to the given Java 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.
Parameters:
parameterName - the name of the parameter
x - the parameter value
Throws:
java.sql.SQLException - if a database access error occurs
Since:
10i Release 1
See Also:
CallableStatement.getString(int)

setBytesForBlob

void setBytesForBlob(java.lang.String parameterName,
                     byte[] x)
                     throws java.sql.SQLException
Sets the designated parameter to the given Java 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..
Parameters:
parameterName - the name of the parameter
x - the parameter value
Throws:
java.sql.SQLException - if a database access error occurs
Since:
10i Release 1
See Also:
CallableStatement.getString(int)

registerOutParameter

void registerOutParameter(java.lang.String parameterName,
                          int sqlType,
                          int scale,
                          int maxLength)
                          throws java.sql.SQLException
Special Oracle version of registerOutParameter for registering CHAR, VARCHAR, LONG, RAW and LONG RAW columns. Depending on the value of OracleConnection.getDataSizeUnits(), maxLength will be measured in bytes or characters.
Parameters:
parameterName - the name of the parameter
sqlType - 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.
Throws:
java.sql.SQLException - if an error occurs (conversion or database-access error)
Since:
10i Release 1

setNull

void setNull(java.lang.String parameterName,
             int sqlType,
             java.lang.String typeName)
             throws java.sql.SQLException
Sets the designated parameter to SQL 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.

Specified by:
setNull in interface java.sql.CallableStatement
Parameters:
parameterName - the name of the parameter
sqlType - a value from java.sql.Types
typeName - the fully-qualified name of an SQL user-defined type; ignored if the parameter is not a user-defined type or SQL REF value
Throws:
java.sql.SQLException - if a database access error occurs
Since:
10i Release 1

setNull

void setNull(java.lang.String parameterName,
             int sqlType)
             throws java.sql.SQLException
Sets the designated parameter to SQL NULL.

Note: You must specify the parameter's SQL type.

Specified by:
setNull in interface java.sql.CallableStatement
Parameters:
parameterName - the name of the parameter
sqlType - the SQL type code defined in java.sql.Types
Throws:
java.sql.SQLException - if a database access error occurs
Since:
9.0.2

setBoolean

void setBoolean(java.lang.String parameterName,
                boolean x)
                throws java.sql.SQLException
Sets the designated parameter to the given Java boolean value. The driver converts this to an SQL BIT value when it sends it to the database.
Specified by:
setBoolean in interface java.sql.CallableStatement
Parameters:
parameterName - the name of the parameter
x - the parameter value
Throws:
java.sql.SQLException - if a database access error occurs
Since:
9.0.2
See Also:
CallableStatement.getBoolean(int)

setByte

void setByte(java.lang.String parameterName,
             byte x)
             throws java.sql.SQLException
Sets the designated parameter to the given Java byte value. The driver converts this to an SQL TINYINT value when it sends it to the database.
Specified by:
setByte in interface java.sql.CallableStatement
Parameters:
parameterName - the name of the parameter
x - the parameter value
Throws:
java.sql.SQLException - if a database access error occurs
Since:
9.0.2
See Also:
CallableStatement.getByte(int)

setShort

void setShort(java.lang.String parameterName,
              short x)
              throws java.sql.SQLException
Sets the designated parameter to the given Java short value. The driver converts this to an SQL SMALLINT value when it sends it to the database.
Specified by:
setShort in interface java.sql.CallableStatement
Parameters:
parameterName - the name of the parameter
x - the parameter value
Throws:
java.sql.SQLException - if a database access error occurs
Since:
9.0.2
See Also:
CallableStatement.getShort(int)

setInt

void setInt(java.lang.String parameterName,
            int x)
            throws java.sql.SQLException
Sets the designated parameter to the given Java int value. The driver converts this to an SQL INTEGER value when it sends it to the database.
Specified by:
setInt in interface java.sql.CallableStatement
Parameters:
parameterName - the name of the parameter
x - the parameter value
Throws:
java.sql.SQLException - if a database access error occurs
Since:
9.0.2
See Also:
CallableStatement.getInt(int)

setLong

void setLong(java.lang.String parameterName,
             long x)
             throws java.sql.SQLException
Sets the designated parameter to the given Java long value. The driver converts this to an SQL BIGINT value when it sends it to the database.
Specified by:
setLong in interface java.sql.CallableStatement
Parameters:
parameterName - the name of the parameter
x - the parameter value
Throws:
java.sql.SQLException - if a database access error occurs
Since:
9.0.2
See Also:
CallableStatement.getLong(int)

setFloat

void setFloat(java.lang.String parameterName,
              float x)
              throws java.sql.SQLException
Sets the designated parameter to the given Java float value. The driver converts this to an SQL FLOAT value when it sends it to the database.
Specified by:
setFloat in interface java.sql.CallableStatement
Parameters:
parameterName - the name of the parameter
x - the parameter value
Throws:
java.sql.SQLException - if a database access error occurs
Since:
9.0.2
See Also:
CallableStatement.getFloat(int)

setBinaryFloat

void setBinaryFloat(java.lang.String parameterName,
                    float x)
                    throws java.sql.SQLException
Sets the designated parameter to the given Java float value. The driver converts this to an SQL BINARY_FLOAT value when it sends it to the database.
Parameters:
parameterName - the name of the parameter
x - the parameter value
Throws:
java.sql.SQLException - if a database access error occurs
Since:
10.0
See Also:
CallableStatement.getFloat(int)

setBinaryDouble

void setBinaryDouble(java.lang.String parameterName,
                     double x)
                     throws java.sql.SQLException
Sets the designated parameter to the given oracle.sql.BINARY_FLOAT value.
Parameters:
parameterName - the name of the parameter
x - the parameter value
Throws:
java.sql.SQLException - if a database access error occurs
Since:
10.0
See Also:
CallableStatement.getFloat(int)

setDouble

void setDouble(java.lang.String parameterName,
               double x)
               throws java.sql.SQLException
Sets the designated parameter to the given Java double value. The driver converts this to an SQL DOUBLE value when it sends it to the database.
Specified by:
setDouble in interface java.sql.CallableStatement
Parameters:
parameterName - the name of the parameter
x - the parameter value
Throws:
java.sql.SQLException - if a database access error occurs
Since:
9.0.2
See Also:
CallableStatement.getDouble(int)

setBigDecimal

void setBigDecimal(java.lang.String parameterName,
                   java.math.BigDecimal x)
                   throws java.sql.SQLException
Sets the designated parameter to the given java.math.BigDecimal value. The driver converts this to an SQL NUMERIC value when it sends it to the database.
Specified by:
setBigDecimal in interface java.sql.CallableStatement
Parameters:
parameterName - the name of the parameter
x - the parameter value
Throws:
java.sql.SQLException - if a database access error occurs
Since:
9.0.2
See Also:
CallableStatement.getBigDecimal(int, int)

setString

void setString(java.lang.String parameterName,
               java.lang.String x)
               throws java.sql.SQLException
Sets the designated parameter to the given Java 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.
Specified by:
setString in interface java.sql.CallableStatement
Parameters:
parameterName - the name of the parameter
x - the parameter value
Throws:
java.sql.SQLException - if a database access error occurs
Since:
9.0.2
See Also:
CallableStatement.getString(int)

setFixedCHAR

void setFixedCHAR(java.lang.String parameterName,
                  java.lang.String x)
                  throws java.sql.SQLException
Throws:
java.sql.SQLException

setCursor

void setCursor(java.lang.String parameterName,
               java.sql.ResultSet x)
               throws java.sql.SQLException
Throws:
java.sql.SQLException

setROWID

void setROWID(java.lang.String parameterName,
              ROWID x)
              throws java.sql.SQLException
Throws:
java.sql.SQLException

setRAW

void setRAW(java.lang.String parameterName,
            RAW x)
            throws java.sql.SQLException
Throws:
java.sql.SQLException

setCHAR

void setCHAR(java.lang.String parameterName,
             CHAR x)
             throws java.sql.SQLException
Throws:
java.sql.SQLException

setDATE

void setDATE(java.lang.String parameterName,
             DATE x)
             throws java.sql.SQLException
Throws:
java.sql.SQLException

setNUMBER

void setNUMBER(java.lang.String parameterName,
               NUMBER x)
               throws java.sql.SQLException
Throws:
java.sql.SQLException

setBLOB

void setBLOB(java.lang.String parameterName,
             BLOB x)
             throws java.sql.SQLException
Throws:
java.sql.SQLException

setBlob

void setBlob(java.lang.String parameterName,
             java.sql.Blob x)
             throws java.sql.SQLException
Specified by:
setBlob in interface java.sql.CallableStatement
Throws:
java.sql.SQLException

setCLOB

void setCLOB(java.lang.String parameterName,
             CLOB x)
             throws java.sql.SQLException
Throws:
java.sql.SQLException

setClob

void setClob(java.lang.String parameterName,
             java.sql.Clob x)
             throws java.sql.SQLException
Specified by:
setClob in interface java.sql.CallableStatement
Throws:
java.sql.SQLException

setBFILE

void setBFILE(java.lang.String parameterName,
              BFILE x)
              throws java.sql.SQLException
Throws:
java.sql.SQLException

setBfile

void setBfile(java.lang.String parameterName,
              BFILE x)
              throws java.sql.SQLException
Throws:
java.sql.SQLException

setBytes

void setBytes(java.lang.String parameterName,
              byte[] x)
              throws java.sql.SQLException
Sets the designated parameter to the given Java array of bytes. The driver converts this to an SQL 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.
Specified by:
setBytes in interface java.sql.CallableStatement
Parameters:
parameterName - the name of the parameter
x - the parameter value
Throws:
java.sql.SQLException - if a database access error occurs
Since:
9.0.2
See Also:
CallableStatement.getBytes(int)

setDate

void setDate(java.lang.String parameterName,
             java.sql.Date x)
             throws java.sql.SQLException
Sets the designated parameter to the given java.sql.Date value. The driver converts this to an SQL DATE value when it sends it to the database.
Specified by:
setDate in interface java.sql.CallableStatement
Parameters:
parameterName - the name of the parameter
x - the parameter value
Throws:
java.sql.SQLException - if a database access error occurs
Since:
9.0.2
See Also:
CallableStatement.getDate(int)

setTime

void setTime(java.lang.String parameterName,
             java.sql.Time x)
             throws java.sql.SQLException
Sets the designated parameter to the given java.sql.Time value. The driver converts this to an SQL TIME value when it sends it to the database.
Specified by:
setTime in interface java.sql.CallableStatement
Parameters:
parameterName - the name of the parameter
x - the parameter value
Throws:
java.sql.SQLException - if a database access error occurs
Since:
9.0.2
See Also:
CallableStatement.getTime(int)

setTimestamp

void setTimestamp(java.lang.String parameterName,
                  java.sql.Timestamp x)
                  throws java.sql.SQLException
Sets the designated parameter to the given java.sql.Timestamp value. The driver converts this to an SQL TIMESTAMP value when it sends it to the database.
Specified by:
setTimestamp in interface java.sql.CallableStatement
Parameters:
parameterName - the name of the parameter
x - the parameter value
Throws:
java.sql.SQLException - if a database access error occurs
Since:
9.0.2
See Also:
CallableStatement.getTimestamp(int)

setINTERVALYM

void setINTERVALYM(java.lang.String parameterName,
                   INTERVALYM x)
                   throws java.sql.SQLException
Throws:
java.sql.SQLException

setINTERVALDS

void setINTERVALDS(java.lang.String parameterName,
                   INTERVALDS x)
                   throws java.sql.SQLException
Throws:
java.sql.SQLException

setTIMESTAMP

void setTIMESTAMP(java.lang.String parameterName,
                  TIMESTAMP x)
                  throws java.sql.SQLException
Throws:
java.sql.SQLException

setTIMESTAMPTZ

void setTIMESTAMPTZ(java.lang.String parameterName,
                    TIMESTAMPTZ x)
                    throws java.sql.SQLException
Throws:
java.sql.SQLException

setTIMESTAMPLTZ

void setTIMESTAMPLTZ(java.lang.String parameterName,
                     TIMESTAMPLTZ x)
                     throws java.sql.SQLException
Throws:
java.sql.SQLException

setAsciiStream

void setAsciiStream(java.lang.String parameterName,
                    java.io.InputStream x,
                    int y)
                    throws java.sql.SQLException
Sets the designated parameter to the given input stream, which will have the specified number of bytes. When a very large ASCII value is input to a 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.

Specified by:
setAsciiStream in interface java.sql.CallableStatement
Parameters:
parameterName - the name of the parameter
x - the Java input stream that contains the ASCII parameter value
length - the number of bytes in the stream
Throws:
java.sql.SQLException - if a database access error occurs
Since:
9.0.2

setBinaryStream

void setBinaryStream(java.lang.String parameterName,
                     java.io.InputStream x,
                     int y)
                     throws java.sql.SQLException
Sets the designated parameter to the given input stream, which will have the specified number of bytes. When a very large binary value is input to a 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.

Specified by:
setBinaryStream in interface java.sql.CallableStatement
Parameters:
parameterName - the name of the parameter
x - the java input stream which contains the binary parameter value
length - the number of bytes in the stream
Throws:
java.sql.SQLException - if a database access error occurs
Since:
9.0.2

setUnicodeStream

void setUnicodeStream(java.lang.String parameterName,
                      java.io.InputStream x,
                      int y)
                      throws java.sql.SQLException
Throws:
java.sql.SQLException

setCharacterStream

void setCharacterStream(java.lang.String parameterName,
                        java.io.Reader x,
                        int y)
                        throws java.sql.SQLException
Sets the designated parameter to the given 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.

Specified by:
setCharacterStream in interface java.sql.CallableStatement
Parameters:
parameterName - the name of the parameter
reader - the java.io.Reader object that contains the UNICODE data used as the designated parameter
length - the number of characters in the stream
Throws:
java.sql.SQLException - if a database access error occurs
Since:
9.0.2

setDate

void setDate(java.lang.String parameterName,
             java.sql.Date x,
             java.util.Calendar cal)
             throws java.sql.SQLException
Sets the designated parameter to the given 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.
Specified by:
setDate in interface java.sql.CallableStatement
Parameters:
parameterName - the name of the parameter
x - the parameter value
cal - the Calendar object the driver will use to construct the date
Throws:
java.sql.SQLException - if a database access error occurs
Since:
9.0.2
See Also:
CallableStatement.getDate(int)

setTime

void setTime(java.lang.String parameterName,
             java.sql.Time x,
             java.util.Calendar cal)
             throws java.sql.SQLException
Sets the designated parameter to the given 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.
Specified by:
setTime in interface java.sql.CallableStatement
Parameters:
parameterName - the name of the parameter
x - the parameter value
cal - the Calendar object the driver will use to construct the time
Throws:
java.sql.SQLException - if a database access error occurs
Since:
9.0.2
See Also:
CallableStatement.getTime(int)

setTimestamp

void setTimestamp(java.lang.String parameterName,
                  java.sql.Timestamp x,
                  java.util.Calendar cal)
                  throws java.sql.SQLException
Sets the designated parameter to the given 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.
Specified by:
setTimestamp in interface java.sql.CallableStatement
Parameters:
parameterName - the name of the parameter
x - the parameter value
cal - the Calendar object the driver will use to construct the timestamp
Throws:
java.sql.SQLException - if a database access error occurs
Since:
9.0.2
See Also:
CallableStatement.getTimestamp(int)

setURL

void setURL(java.lang.String parameterName,
            java.net.URL x)
            throws java.sql.SQLException
Sets the designated parameter to the given java.net.URL object. The driver converts this to an SQL DATALINK value when it sends it to the database.
Specified by:
setURL in interface java.sql.CallableStatement
Parameters:
parameterName - the name of the parameter
val - the parameter value
Throws:
java.sql.SQLException - if a database access error occurs, or if a URL is malformed
Since:
9.0.2
See Also:
CallableStatement.getURL(int)

setArray

void setArray(java.lang.String parameterName,
              java.sql.Array x)
              throws java.sql.SQLException
Throws:
java.sql.SQLException

setARRAY

void setARRAY(java.lang.String parameterName,
              ARRAY x)
              throws java.sql.SQLException
Throws:
java.sql.SQLException

setOPAQUE

void setOPAQUE(java.lang.String parameterName,
               OPAQUE x)
               throws java.sql.SQLException
Throws:
java.sql.SQLException

setStructDescriptor

void setStructDescriptor(java.lang.String parameterName,
                         StructDescriptor x)
                         throws java.sql.SQLException
Throws:
java.sql.SQLException

setSTRUCT

void setSTRUCT(java.lang.String parameterName,
               STRUCT x)
               throws java.sql.SQLException
Throws:
java.sql.SQLException

setCustomDatum

void setCustomDatum(java.lang.String parameterName,
                    CustomDatum x)
                    throws java.sql.SQLException
Throws:
java.sql.SQLException

setORAData

void setORAData(java.lang.String parameterName,
                ORAData x)
                throws java.sql.SQLException
Throws:
java.sql.SQLException

setObject

void setObject(java.lang.String parameterName,
               java.lang.Object x,
               int targetSqlType,
               int scale)
               throws java.sql.SQLException
Sets the value of the designated parameter with the given object. The second argument must be an object type; for integral values, the 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.

Specified by:
setObject in interface java.sql.CallableStatement
Parameters:
parameterName - the name of the parameter
x - the object containing the input parameter value
targetSqlType - 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.
Throws:
java.sql.SQLException - if a database access error occurs
Since:
9.0.2
See Also:
Types, CallableStatement.getObject(int)

setObject

void setObject(java.lang.String parameterName,
               java.lang.Object x,
               int y)
               throws java.sql.SQLException
Sets the value of the designated parameter with the given object. This method is like the method setObject above, except that it assumes a scale of zero.
Specified by:
setObject in interface java.sql.CallableStatement
Parameters:
parameterName - the name of the parameter
x - the object containing the input parameter value
targetSqlType - the SQL type (as defined in java.sql.Types) to be sent to the database
Throws:
java.sql.SQLException - if a database access error occurs
Since:
9.0.2
See Also:
CallableStatement.getObject(int)

setRefType

void setRefType(java.lang.String parameterName,
                REF x)
                throws java.sql.SQLException
Throws:
java.sql.SQLException

setRef

void setRef(java.lang.String parameterName,
            java.sql.Ref x)
            throws java.sql.SQLException
Throws:
java.sql.SQLException

setREF

void setREF(java.lang.String parameterName,
            REF x)
            throws java.sql.SQLException
Throws:
java.sql.SQLException

setObject

void setObject(java.lang.String parameterName,
               java.lang.Object x)
               throws java.sql.SQLException
Sets the value of the designated parameter with the given object. The second parameter must be of type 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.

Specified by:
setObject in interface java.sql.CallableStatement
Parameters:
parameterName - the name of the parameter
x - the object containing the input parameter value
Throws:
java.sql.SQLException - if a database access error occurs or if the given Object parameter is ambiguous
Since:
9.0.2
See Also:
CallableStatement.getObject(int)

setOracleObject

void setOracleObject(java.lang.String parameterName,
                     Datum x)
                     throws java.sql.SQLException
Throws:
java.sql.SQLException

Skip navigation links

Oracle® Database JDBC Java API Reference
11g Release 2

E13995-02


Copyright © 2009, Oracle and/or its affiliates. All rights reserved.