Oracle10g JDBC

oracle.jdbc
Interface OracleCallableStatement

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

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:@", "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 java.sql.Statement
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO
 
Fields inherited from interface oracle.jdbc.OraclePreparedStatement
FORM_CHAR, FORM_NCHAR
 
Fields inherited from interface oracle.jdbc.OracleStatement
EXPLICIT, IMPLICIT, NEW
 
Method Summary
 java.lang.Object getAnyDataEmbeddedObject(int parameterIndex)
          Retrieves data of an embedded object within AnyData
 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.
 java.io.InputStream getBinaryStream(int parameterIndex)
          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.
 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)
          Special Oracle version of registerOutParameter for registering CHAR, VARCHAR, LONG, RAW and LONG RAW columns.
 void registerOutParameterChars(int paramIndex, int sqlType, int scale, int maxLength)
          Special Oracle version of registerOutParameter for registering CHAR, VARCHAR, LONG, RAW and LONG RAW columns.
 int sendBatch()
          Send the sets of parameters batched (for Oracle-style batching only).
 void setBinaryDouble(java.lang.String parameterName, BINARY_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 setExecuteBatch(int nrows)
          Set the batch value (for Oracle-style batching only).
 void setStringForClob(java.lang.String parameterName, java.lang.String x)
          Sets the designated parameter to the given Java String value.
 
Methods inherited from interface java.sql.CallableStatement
getArray, getArray, getBigDecimal, getBigDecimal, getBigDecimal, getBlob, getBlob, getBoolean, getBoolean, getByte, getByte, getBytes, getBytes, getClob, getClob, getDate, getDate, getDate, getDate, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getLong, getLong, getObject, getObject, getObject, getObject, getRef, getRef, getShort, getShort, getString, getString, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getURL, getURL, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, setAsciiStream, setBigDecimal, setBinaryStream, setBoolean, setByte, setBytes, setCharacterStream, setDate, setDate, setDouble, setFloat, setInt, setLong, setNull, setNull, setObject, setObject, setObject, setShort, setString, setTime, setTime, setTimestamp, setTimestamp, setURL, wasNull
 
Methods inherited from interface java.sql.PreparedStatement
addBatch, clearParameters, execute, executeQuery, executeUpdate, getMetaData, getParameterMetaData, setArray, setAsciiStream, setBigDecimal, setBinaryStream, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setClob, setDate, setDate, setDouble, setFloat, setInt, setLong, setNull, setNull, setObject, setObject, setObject, setRef, setShort, setString, setTime, setTime, setTimestamp, setTimestamp, setUnicodeStream, setURL
 
Methods inherited from interface java.sql.Statement
addBatch, cancel, clearBatch, clearWarnings, close, execute, execute, execute, execute, executeBatch, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setQueryTimeout
 
Methods inherited from interface oracle.jdbc.OraclePreparedStatement
defineParameterType, defineParameterTypeBytes, defineParameterTypeChars, getExecuteBatch, OracleGetParameterMetaData, setARRAY, setArrayAtName, setARRAYAtName, setAsciiStreamAtName, setBfile, setBFILE, setBfileAtName, setBFILEAtName, setBigDecimalAtName, setBinaryDouble, setBinaryDouble, setBinaryDoubleAtName, setBinaryDoubleAtName, setBinaryFloat, setBinaryFloat, setBinaryFloatAtName, setBinaryFloatAtName, setBinaryStreamAtName, setBLOB, setBlobAtName, setBLOBAtName, setBooleanAtName, setByteAtName, setBytesAtName, setCHAR, setCHARAtName, setCheckBindTypes, setCLOB, setClobAtName, setCLOBAtName, setCursor, setCursorAtName, setCustomDatum, setCustomDatumAtName, setDATE, 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, setTIMESTAMP, setTimestampAtName, setTIMESTAMPAtName, setTIMESTAMPLTZ, setTIMESTAMPLTZAtName, setTIMESTAMPTZ, setTIMESTAMPTZAtName, setUnicodeStreamAtName, setURLAtName
 
Methods inherited from interface oracle.jdbc.OracleStatement
clearDefines, closeWithKey, creationState, defineColumnType, defineColumnType, defineColumnType, defineColumnType, defineColumnTypeBytes, defineColumnTypeChars, getRowPrefetch, isNCHAR, setResultSetCache, setRowPrefetch
 

Method Detail

getARRAY

public 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

public 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

public 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

public 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)

getBLOB

public 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

public 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

public java.io.Reader getCharacterStream(int parameterIndex)
                                  throws java.sql.SQLException
Retrieves data into an java.io.Reader object.

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

public 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

public 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

public 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

public 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

public java.lang.Object getAnyDataEmbeddedObject(int parameterIndex)
                                          throws java.sql.SQLException
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

public 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

public 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

public 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

public 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

public 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

public 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

public 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

public 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

public 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

public 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

public 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

public 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

public 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

public 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)

registerOutParameter

public 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

public void registerOutParameterBytes(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. 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

public void registerOutParameterChars(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. 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

public 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

public 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

public 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

public 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

public 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

public 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.
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

public 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

public 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

public 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.

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

public 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

Oracle10g JDBC

Copyright © 1998,2004, Oracle. All rights reserved