Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

oracle.adfnmc.java.sql
Interface CallableStatement

All Superinterfaces:
PreparedStatement, Statement

public interface CallableStatement
extends PreparedStatement

An interface used to call Stored Procedures.

The JDBC API provides an SQL escape syntax allowing Stored Procedures to be called in a standard way for all databases. The JDBC escape syntax has two forms. One form includes a result parameter. The second form does not include a result parameter. Where the result parameter is used, it must be declared as an OUT parameter. Other parameters can be declared as IN, OUT or INOUT. Parameters are referenced either by name or by a numerical index, with the first parameter being 1, the second 1 and so on. Here are examples of the two forms of the escape syntax: { ?= call <.procedurename>.[([parameter1,parameter2,...])]} {call <.procedurename>.[([parameter1,parameter2,...])]}

IN parameters are set before calling the procedure, using the setter methods which are inherited from PreparedStatement. For OUT parameters, their Type must be registered before executing the stored procedure, and the value is retrieved using the getter methods defined in the CallableStatement interface.

CallableStatements can return one or more ResultSets. Where multiple ResultSets are returned they are accessed using the methods inherited from the Statement interface.


Field Summary
 
Fields inherited from interface oracle.adfnmc.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
 Array getArray(int parameterIndex)
          Gets the value of a specified JDBC ARRAY parameter as a java.sql.Array.
 Array getArray(java.lang.String parameterName)
          Gets the value of a specified JDBC ARRAY parameter as a java.sql.Array.
 Blob getBlob(int parameterIndex)
          Gets the value of a specified JDBC BLOB parameter as a java.sql.Blob
 Blob getBlob(java.lang.String parameterName)
          Gets the value of a specified JDBC BLOB parameter as a java.sql.Blob
 boolean getBoolean(int parameterIndex)
          Gets the value of a specified JDBC BIT parameter as a boolean
 boolean getBoolean(java.lang.String parameterName)
          Gets the value of a specified JDBC BIT parameter as a boolean
 byte getByte(int parameterIndex)
          Gets the value of a specified JDBC TINYINT parameter as a byte
 byte getByte(java.lang.String parameterName)
          Gets the value of a specified JDBC TINYINT parameter as a Java byte.
 byte[] getBytes(int parameterIndex)
          Returns a byte array representation of the indexed JDBC BINARY or VARBINARY parameter.
 byte[] getBytes(java.lang.String parameterName)
          Returns a byte array representation of the named JDBC BINARY or VARBINARY parameter.
 Clob getClob(int parameterIndex)
          Gets the value of a specified JDBC CLOB parameter as a java.sql.Clob
 Clob getClob(java.lang.String parameterName)
          Gets the value of a specified JDBC CLOB parameter as a java.sql.Clob
 Date getDate(int parameterIndex)
          Gets the value of a specified JDBC DATE parameter as a java.sql.Date.
 Date getDate(int parameterIndex, java.util.Calendar cal)
          Gets the value of a specified JDBC DATE parameter as a java.sql.Date., using a specified Calendar to construct the date.
 Date getDate(java.lang.String parameterName)
          Gets the value of a specified JDBC DATE parameter as a java.sql.Date.
 Date getDate(java.lang.String parameterName, java.util.Calendar cal)
          Gets the value of a specified JDBC DATE parameter as a java.sql.Date., using a specified Calendar to construct the date.
 double getDouble(int parameterIndex)
          Gets the value of a specified JDBC DOUBLE parameter as a double
 double getDouble(java.lang.String parameterName)
          Gets the value of a specified JDBC DOUBLE parameter as a double
 float getFloat(int parameterIndex)
          Gets the value of a specified JDBC FLOAT parameter as a float
 float getFloat(java.lang.String parameterName)
          Gets the value of a specified JDBC FLOAT parameter as a Java float.
 int getInt(int parameterIndex)
          Gets the value of a specified JDBC INTEGER parameter as an int
 int getInt(java.lang.String parameterName)
          Gets the value of a specified JDBC INTEGER parameter as an int
 long getLong(int parameterIndex)
          Gets the value of a specified JDBC BIGINT parameter as a long
 long getLong(java.lang.String parameterName)
          Gets the value of a specified JDBC BIGINT parameter as a long
 java.lang.Object getObject(int parameterIndex)
          Gets the value of a specified parameter as a Java Object.
 java.lang.Object getObject(java.lang.String parameterName)
          Gets the value of a specified parameter as an Object.
 Ref getRef(int parameterIndex)
          Gets the value of a specified JDBC REF() parameter as a java.sql.Ref
 Ref getRef(java.lang.String parameterName)
          Gets the value of a specified JDBC REF() parameter as a java.sql.Ref
 short getShort(int parameterIndex)
          Gets the value of a specified JDBC SMALLINT parameter as a short
 short getShort(java.lang.String parameterName)
          Gets the value of a specified JDBC SMALLINT parameter as a short
 java.lang.String getString(int parameterIndex)
          Returns the indexed parameter's value as a string.
 java.lang.String getString(java.lang.String parameterName)
          Returns the named parameter's value as a string.
 Time getTime(int parameterIndex)
          Gets the value of a specified JDBC TIME parameter as a java.sql.Time.
 Time getTime(int parameterIndex, java.util.Calendar cal)
          Gets the value of a specified JDBC TIME parameter as a java.sql.Time, using the supplied Calendar to construct the time.
 Time getTime(java.lang.String parameterName)
          Gets the value of a specified JDBC TIME parameter as a
 Time getTime(java.lang.String parameterName, java.util.Calendar cal)
          Gets the value of a specified JDBC TIME parameter as a java.sql.Time, using the supplied Calendar to construct the time.
 Timestamp getTimestamp(int parameterIndex)
          Returns the indexed parameter's TIMESTAMP value as a java.sql.Timestamp.
 Timestamp getTimestamp(int parameterIndex, java.util.Calendar cal)
          Returns the indexed parameter's TIMESTAMP value as a java.sql.Timestamp.
 Timestamp getTimestamp(java.lang.String parameterName)
          Returns the named parameter's TIMESTAMP value as a java.sql.Timestamp.
 Timestamp getTimestamp(java.lang.String parameterName, java.util.Calendar cal)
          Returns the indexed parameter's TIMESTAMP value as a java.sql.Timestamp.
 void registerOutParameter(int parameterIndex, int sqlType)
          Defines the Type of a specified OUT parameter.
 void registerOutParameter(int parameterIndex, int sqlType, int scale)
          Defines the Type of a specified OUT parameter.
 void registerOutParameter(int paramIndex, int sqlType, java.lang.String typeName)
          Defines the Type of a specified OUT parameter.
 void registerOutParameter(java.lang.String parameterName, int sqlType)
          Defines the Type of a specified OUT parameter.
 void registerOutParameter(java.lang.String parameterName, int sqlType, int scale)
          Defines the Type of a specified OUT parameter.
 void registerOutParameter(java.lang.String parameterName, int sqlType, java.lang.String typeName)
          Defines the Type of a specified OUT parameter.
 void setAsciiStream(java.lang.String parameterName, java.io.InputStream theInputStream, int length)
          Sets the value of a specified parameter to the content of a supplied InputStream, which has a specified number of bytes.
 void setBinaryStream(java.lang.String parameterName, java.io.InputStream theInputStream, int length)
          Sets the value of a specified parameter to the content of a supplied binary InputStream, which has a specified number of bytes.
 void setBoolean(java.lang.String parameterName, boolean theBoolean)
          Sets the value of a specified parameter to a supplied boolean value.
 void setByte(java.lang.String parameterName, byte theByte)
          Sets the value of a specified parameter to a supplied byte value.
 void setBytes(java.lang.String parameterName, byte[] theBytes)
          Sets the value of a specified parameter to a supplied array of bytes.
 void setCharacterStream(java.lang.String parameterName, java.io.Reader reader, int length)
          Sets the value of a specified parameter to the character content of a Reader object, with the specified length of character data.
 void setDate(java.lang.String parameterName, Date theDate)
          Sets the value of a specified parameter to a supplied java.sql.Date value.
 void setDate(java.lang.String parameterName, Date theDate, java.util.Calendar cal)
          Sets the value of a specified parameter to a supplied java.sql.Date value, using a supplied Calendar to map the Date.
 void setDouble(java.lang.String parameterName, double theDouble)
          Sets the value of a specified parameter to a supplied double value.
 void setFloat(java.lang.String parameterName, float theFloat)
          Sets the value of a specified parameter to to a supplied float value.
 void setInt(java.lang.String parameterName, int theInt)
          Sets the value of a specified parameter to a supplied int value.
 void setLong(java.lang.String parameterName, long theLong)
          Sets the value of a specified parameter to a supplied long value.
 void setNull(java.lang.String parameterName, int sqlType)
          Sets the value of a specified parameter to SQL NULL.
 void setNull(java.lang.String parameterName, int sqlType, java.lang.String typeName)
          Sets the value of a specified parameter to be SQL NULL where the parameter type is either REF or user defined (e.g.
 void setObject(java.lang.String parameterName, java.lang.Object theObject)
          Sets the value of a specified parameter using a supplied object.
 void setObject(java.lang.String parameterName, java.lang.Object theObject, int targetSqlType)
          Sets the value of a specified parameter using a supplied object.
 void setObject(java.lang.String parameterName, java.lang.Object theObject, int targetSqlType, int scale)
          Sets the value of a specified parameter using a supplied object.
 void setShort(java.lang.String parameterName, short theShort)
          Sets the value of a specified parameter to a supplied short value.
 void setString(java.lang.String parameterName, java.lang.String theString)
          Sets the value of a specified parameter to a supplied String.
 void setTime(java.lang.String parameterName, Time theTime)
          Sets the value of the parameter named parameterName to the value of the supplied java.sql.Time.
 void setTime(java.lang.String parameterName, Time theTime, java.util.Calendar cal)
          Sets the value of the parameter named parameterName to the value of the supplied java.sql.Time using the supplied Calendar.
 void setTimestamp(java.lang.String parameterName, Timestamp theTimestamp)
          Sets the value of a specified parameter to a supplied java.sql.Timestamp value.
 void setTimestamp(java.lang.String parameterName, Timestamp theTimestamp, java.util.Calendar cal)
          Sets the value of a specified parameter to a supplied java.sql.Timestamp value, using the supplied Calendar.
 boolean wasNull()
          Gets whether the value of the last OUT parameter read was SQL NULL.
 
Methods inherited from interface oracle.adfnmc.java.sql.PreparedStatement
addBatch, clearParameters, execute, executeQuery, executeUpdate, getMetaData, getParameterMetaData, setArray, setAsciiStream, 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
 
Methods inherited from interface oracle.adfnmc.java.sql.Statement
addBatch, cancel, clearBatch, clearWarnings, close, execute, execute, execute, execute, executeBatch, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setQueryTimeout
 

Method Detail

getArray

Array getArray(int parameterIndex)
               throws SQLException
Gets the value of a specified JDBC ARRAY parameter as a java.sql.Array.

Parameters:
parameterIndex - the parameter number index, where the first parameter has index 1
Returns:
a java.sql.Array containing the parameter value
Throws:
SQLException - if a database error happens

getArray

Array getArray(java.lang.String parameterName)
               throws SQLException
Gets the value of a specified JDBC ARRAY parameter as a java.sql.Array.

Parameters:
parameterName - the parameter of interest's name
Returns:
a java.sql.Array containing the parameter value
Throws:
SQLException - if there is a problem accessing the database

getBlob

Blob getBlob(int parameterIndex)
             throws SQLException
Gets the value of a specified JDBC BLOB parameter as a java.sql.Blob

Parameters:
parameterIndex - the parameter number index, where the first parameter has index 1
Returns:
a java.sql.Blob with the value. null if the value is SQL NULL.
Throws:
SQLException - if a database error happens

getBlob

Blob getBlob(java.lang.String parameterName)
             throws SQLException
Gets the value of a specified JDBC BLOB parameter as a java.sql.Blob

Parameters:
parameterName - the name of the parameter
Returns:
a java.sql.Blob with the value. null if the value is SQL NULL.
Throws:
SQLException - if a database error happens

getBoolean

boolean getBoolean(int parameterIndex)
                   throws SQLException
Gets the value of a specified JDBC BIT parameter as a boolean

Parameters:
parameterIndex - the parameter number index, where the first parameter has index 1
Returns:
a boolean representing the parameter value. false if the value is SQL NULL
Throws:
SQLException - if a database error happens

getBoolean

boolean getBoolean(java.lang.String parameterName)
                   throws SQLException
Gets the value of a specified JDBC BIT parameter as a boolean

Parameters:
parameterName - the parameter of interest's name
Returns:
a boolean representation of the value of the parameter. false is returned if the SQL value is NULL.
Throws:
SQLException - if there is a problem accessing the database

getByte

byte getByte(int parameterIndex)
             throws SQLException
Gets the value of a specified JDBC TINYINT parameter as a byte

Parameters:
parameterIndex - the parameter number index, where the first parameter has index 1
Returns:
a byte with the value of the parameter. 0 if the value is SQL NULL.
Throws:
SQLException - if a database error happens

getByte

byte getByte(java.lang.String parameterName)
             throws SQLException
Gets the value of a specified JDBC TINYINT parameter as a Java byte.

Parameters:
parameterName - the parameter of interest's name
Returns:
a byte representation of the value of the parameter. 0 is returned if the SQL value is NULL.
Throws:
SQLException - if there is a problem accessing the database

getBytes

byte[] getBytes(int parameterIndex)
                throws SQLException
Returns a byte array representation of the indexed JDBC BINARY or VARBINARY parameter.

Parameters:
parameterIndex - the parameter number index, where the first parameter has index 1
Returns:
an array of bytes with the value of the parameter. null if the value is SQL NULL.
Throws:
SQLException - if there is a problem accessing the database

getBytes

byte[] getBytes(java.lang.String parameterName)
                throws SQLException
Returns a byte array representation of the named JDBC BINARY or VARBINARY parameter.

Parameters:
parameterName - the name of the parameter
Returns:
an array of bytes with the value of the parameter. null if the value is SQL NULL.
Throws:
SQLException - if there is a problem accessing the database

getClob

Clob getClob(int parameterIndex)
             throws SQLException
Gets the value of a specified JDBC CLOB parameter as a java.sql.Clob

Parameters:
parameterIndex - the parameter number index, where the first parameter has index 1
Returns:
a java.sql.Clob with the value of the parameter. null if the value is SQL NULL.
Throws:
SQLException - if a database error happens

getClob

Clob getClob(java.lang.String parameterName)
             throws SQLException
Gets the value of a specified JDBC CLOB parameter as a java.sql.Clob

Parameters:
parameterName - the name of the parameter
Returns:
a java.sql.Clob with the value of the parameter. null if the value is SQL NULL.
Throws:
SQLException - if a database error happens

getDate

Date getDate(int parameterIndex)
             throws SQLException
Gets the value of a specified JDBC DATE parameter as a java.sql.Date.

Parameters:
parameterIndex - the parameter number index, where the first parameter has index 1
Returns:
the java.sql.Date with the parameter value. null if the value is SQL NULL.
Throws:
SQLException - if a database error happens

getDate

Date getDate(int parameterIndex,
             java.util.Calendar cal)
             throws SQLException
Gets the value of a specified JDBC DATE parameter as a java.sql.Date., using a specified Calendar to construct the date.

The JDBC driver uses the Calendar to create the Date using a particular timezone and locale. Default behaviour of the driver is to use the Java virtual machine default settings.

Parameters:
parameterIndex - the parameter number index, where the first parameter has index 1
cal - the Calendar to use to construct the Date
Returns:
the java.sql.Date with the parameter value. null if the value is SQL NULL.
Throws:
SQLException - if a database error happens

getDate

Date getDate(java.lang.String parameterName)
             throws SQLException
Gets the value of a specified JDBC DATE parameter as a java.sql.Date.

Parameters:
parameterName - the name of the parameter
Returns:
the java.sql.Date with the parameter value. null if the value is SQL NULL.
Throws:
SQLException - if a database error happens

getDate

Date getDate(java.lang.String parameterName,
             java.util.Calendar cal)
             throws SQLException
Gets the value of a specified JDBC DATE parameter as a java.sql.Date., using a specified Calendar to construct the date.

The JDBC driver uses the Calendar to create the Date using a particular timezone and locale. Default behaviour of the driver is to use the Java virtual machine default settings.

Parameters:
parameterName - the parameter name
cal - used for creating the returned Date
Returns:
the java.sql.Date with the parameter value. null if the value is SQL NULL.
Throws:
SQLException - if a database error happens

getDouble

double getDouble(int parameterIndex)
                 throws SQLException
Gets the value of a specified JDBC DOUBLE parameter as a double

Parameters:
parameterIndex - the parameter number index, where the first parameter has index 1
Returns:
the double with the parameter value. 0.0 if the value is SQL NULL.
Throws:
SQLException - if a database error happens

getDouble

double getDouble(java.lang.String parameterName)
                 throws SQLException
Gets the value of a specified JDBC DOUBLE parameter as a double

Parameters:
parameterName - the parameter name
Returns:
the parameter value as represented in a Java double. An SQL value of NULL gets represented as 0 (zero).
Throws:
SQLException - if there is a problem accessing the database

getFloat

float getFloat(int parameterIndex)
               throws SQLException
Gets the value of a specified JDBC FLOAT parameter as a float

Parameters:
parameterIndex - the parameter number index, where the first parameter has index 1
Returns:
the float with the parameter value. 0.0 if the value is SQL NULL.
Throws:
SQLException - if a database error happens

getFloat

float getFloat(java.lang.String parameterName)
               throws SQLException
Gets the value of a specified JDBC FLOAT parameter as a Java float.

Parameters:
parameterName - the parameter name
Returns:
the parameter value as represented in a Java float. An SQL value of NULL gets represented as 0 (zero).
Throws:
SQLException - if there is a problem accessing the database

getInt

int getInt(int parameterIndex)
           throws SQLException
Gets the value of a specified JDBC INTEGER parameter as an int

Parameters:
parameterIndex - the parameter number index, where the first parameter has index 1
Returns:
the int with the parameter value. 0 if the value is SQL NULL.
Throws:
SQLException - if a database error happens

getInt

int getInt(java.lang.String parameterName)
           throws SQLException
Gets the value of a specified JDBC INTEGER parameter as an int

Parameters:
parameterName - the name of the parameter
Returns:
the int with the parameter value. 0 if the value is SQL NULL.
Throws:
SQLException - if a database error happens

getLong

long getLong(int parameterIndex)
             throws SQLException
Gets the value of a specified JDBC BIGINT parameter as a long

Parameters:
parameterIndex - the parameter number index, where the first parameter has index 1
Returns:
the long with the parameter value. 0 if the value is SQL NULL.
Throws:
SQLException - if a database error happens

getLong

long getLong(java.lang.String parameterName)
             throws SQLException
Gets the value of a specified JDBC BIGINT parameter as a long

Parameters:
parameterName - the name of the parameter
Returns:
the long with the parameter value. 0 if the value is SQL NULL.
Throws:
SQLException - if a database error happens

getObject

java.lang.Object getObject(int parameterIndex)
                           throws SQLException
Gets the value of a specified parameter as a Java Object.

The object type returned is the JDBC type registered for the parameter with a registerOutParameter call. If a parameter was registered as a java.sql.Types.OTHER then it may hold abstract types that are particular to the connected database.

Parameters:
parameterIndex - the parameter number index, where the first parameter has index 1
Returns:
an Object holding the value of the parameter.
Throws:
SQLException - if there is a problem accessing the database

getObject

java.lang.Object getObject(java.lang.String parameterName)
                           throws SQLException
Gets the value of a specified parameter as an Object.

The object type returned is the JDBC type registered for the parameter with a registerOutParameter call. If a parameter was registered as a java.sql.Types.OTHER then it may hold abstract types that are particular to the connected database.

Parameters:
parameterName - the parameter name
Returns:
the Java Object representation of the value of the parameter.
Throws:
SQLException - if there is a problem accessing the database

getRef

Ref getRef(int parameterIndex)
           throws SQLException
Gets the value of a specified JDBC REF() parameter as a java.sql.Ref

Parameters:
parameterIndex - the parameter number index, where the first parameter has index 1
Returns:
a java.sql.Ref with the parameter value. null if the value is SQL NULL.
Throws:
SQLException - if a database error happens

getRef

Ref getRef(java.lang.String parameterName)
           throws SQLException
Gets the value of a specified JDBC REF() parameter as a java.sql.Ref

Parameters:
parameterName - the parameter name
Returns:
the target parameter's value in the form of a java.sql.Ref. A null reference is returned for a parameter value of SQL NULL.
Throws:
SQLException - if there is a problem accessing the database

getShort

short getShort(int parameterIndex)
               throws SQLException
Gets the value of a specified JDBC SMALLINT parameter as a short

Parameters:
parameterIndex - the parameter number index, where the first parameter has index 1
Returns:
a short with the parameter value. 0 if the value is SQL NULL.
Throws:
SQLException - if a database error happens

getShort

short getShort(java.lang.String parameterName)
               throws SQLException
Gets the value of a specified JDBC SMALLINT parameter as a short

Parameters:
parameterName - the parameter name
Returns:
the value of the target parameter as a Java short. If the value is an SQL NULL then 0 (zero) is returned.
Throws:
SQLException - if there is a problem accessing the database

getString

java.lang.String getString(int parameterIndex)
                           throws SQLException
Returns the indexed parameter's value as a string. The parameter value must be one of the JDBC types CHAR, VARCHAR or LONGVARCHAR.

The string corresponding to a CHAR of fixed length will be of identical length to the value in the database inclusive of padding characters.

Parameters:
parameterIndex - the parameter number index, where the first parameter has index 1
Returns:
a String with the parameter value. null if the value is SQL NULL.
Throws:
SQLException - if there is a problem accessing the database

getString

java.lang.String getString(java.lang.String parameterName)
                           throws SQLException
Returns the named parameter's value as a string. The parameter value must be one of the JDBC types CHAR, VARCHAR or LONGVARCHAR.

The string corresponding to a CHAR of fixed length will be of identical length to the value in the database inclusive of padding characters.

Parameters:
parameterName - the parameter name
Returns:
a String with the parameter value. null if the value is SQL NULL.
Throws:
SQLException - if there is a problem accessing the database

getTime

Time getTime(int parameterIndex)
             throws SQLException
Gets the value of a specified JDBC TIME parameter as a java.sql.Time.

Parameters:
parameterIndex - the parameter number index, where the first parameter has index 1
Returns:
a java.sql.Time with the parameter value. null if the value is SQL NULL.
Throws:
SQLException - if a database error happens

getTime

Time getTime(int parameterIndex,
             java.util.Calendar cal)
             throws SQLException
Gets the value of a specified JDBC TIME parameter as a java.sql.Time, using the supplied Calendar to construct the time. The JDBC driver uses the Calendar to handle specific timezones and locales when creating the Time.

Parameters:
parameterIndex - the parameter number index, where the first parameter has index 1
cal - the Calendar to use in constructing the Time.
Returns:
a java.sql.Time with the parameter value. null if the value is SQL NULL.
Throws:
SQLException - if a database error happens

getTime

Time getTime(java.lang.String parameterName)
             throws SQLException
Gets the value of a specified JDBC TIME parameter as a

Parameters:
parameterName - the parameter name
Returns:
a new java.sql.Time with the parameter value. A null reference is returned for an SQL value of NULL
Throws:
SQLException - if a database error happens

getTime

Time getTime(java.lang.String parameterName,
             java.util.Calendar cal)
             throws SQLException
Gets the value of a specified JDBC TIME parameter as a java.sql.Time, using the supplied Calendar to construct the time. The JDBC driver uses the Calendar to handle specific timezones and locales when creating the Time.

Parameters:
parameterName - the parameter name
cal - used for creating the returned Time
Returns:
a java.sql.Time with the parameter value. A null reference is returned for an SQL value of NULL
Throws:
SQLException - if a database error happens

getTimestamp

Timestamp getTimestamp(int parameterIndex)
                       throws SQLException
Returns the indexed parameter's TIMESTAMP value as a java.sql.Timestamp.

Parameters:
parameterIndex - the parameter number index, where the first parameter has index 1
Returns:
a new java.sql.Timestamp with the parameter value. A null reference is returned for an SQL value of NULL
Throws:
SQLException - if a database error happens

getTimestamp

Timestamp getTimestamp(int parameterIndex,
                       java.util.Calendar cal)
                       throws SQLException
Returns the indexed parameter's TIMESTAMP value as a java.sql.Timestamp. The JDBC driver uses the supplied Calendar to handle specific timezones and locales when creating the result.

Parameters:
parameterIndex - the parameter number index, where the first parameter has index 1
cal - used for creating the returned Timestamp
Returns:
a new java.sql.Timestamp with the parameter value. A null reference is returned for an SQL value of NULL
Throws:
SQLException - if a database error happens

getTimestamp

Timestamp getTimestamp(java.lang.String parameterName)
                       throws SQLException
Returns the named parameter's TIMESTAMP value as a java.sql.Timestamp.

Parameters:
parameterName - the parameter name
Returns:
a new java.sql.Timestamp with the parameter value. A null reference is returned for an SQL value of NULL
Throws:
SQLException - if a database error happens

getTimestamp

Timestamp getTimestamp(java.lang.String parameterName,
                       java.util.Calendar cal)
                       throws SQLException
Returns the indexed parameter's TIMESTAMP value as a java.sql.Timestamp. The JDBC driver uses the supplied Calendar to handle specific timezones and locales when creating the result.

Parameters:
parameterName - the parameter name
cal - used for creating the returned Timestamp
Returns:
a new java.sql.Timestamp with the parameter value. A null reference is returned for an SQL value of NULL
Throws:
SQLException - if a database error happens

registerOutParameter

void registerOutParameter(int parameterIndex,
                          int sqlType)
                          throws SQLException
Defines the Type of a specified OUT parameter. All OUT parameters must have their Type defined before a stored procedure is executed.

The Type defined by this method fixes the Java type that must be retrieved using the getter methods of CallableStatement. If a database specific type is expected for a parameter, the Type java.sql.Types.OTHER should be used. Note that there is another variant of this method for User Defined Types or a REF type.

Parameters:
parameterIndex - the parameter number index, where the first parameter has index 1
sqlType - the JDBC type as defined by java.sql.Types. The JDBC types NUMERIC and DECIMAL should be defined using the version of registerOutParameter that takes a scale parameter.
Throws:
SQLException - if a database error happens

registerOutParameter

void registerOutParameter(int parameterIndex,
                          int sqlType,
                          int scale)
                          throws SQLException
Defines the Type of a specified OUT parameter. All OUT parameters must have their Type defined before a stored procedure is executed. This version of the registerOutParameter method, which has a scale parameter, should be used for the JDBC types NUMERIC and DECIMAL, where there is a need to specify the number of digits expected after the decimal point.

The Type defined by this method fixes the Java type that must be retrieved using the getter methods of CallableStatement.

Parameters:
parameterIndex - the parameter number index, where the first parameter has index 1
sqlType - the JDBC type as defined by java.sql.Types.
scale - the number of digits after the decimal point. Must be greater than or equal to 0.
Throws:
SQLException - if a database error happens

registerOutParameter

void registerOutParameter(int paramIndex,
                          int sqlType,
                          java.lang.String typeName)
                          throws SQLException
Defines the Type of a specified OUT parameter. This variant of the method is designed for use with parameters that are User Defined Types (UDT) or a REF type, although it can be used for any type.

Parameters:
paramIndex - the parameter number index, where the first parameter has index 1
sqlType - a JDBC type expressed as a constant from Types
typeName - an SQL type name. For a REF type, this name should be the fully qualified name of the referenced type.
Throws:
SQLException - if a database error happens

registerOutParameter

void registerOutParameter(java.lang.String parameterName,
                          int sqlType)
                          throws SQLException
Defines the Type of a specified OUT parameter. All OUT parameters must have their Type defined before a stored procedure is executed.

The Type defined by this method fixes the Java type that must be retrieved using the getter methods of CallableStatement. If a database specific type is expected for a parameter, the Type java.sql.Types.OTHER should be used. Note that there is another variant of this method for User Defined Types or a REF type.

Parameters:
parameterName - the parameter name
sqlType - a JDBC type expressed as a constant from Types. Types NUMERIC and DECIMAL should be defined using the variant of this method that takes a scale parameter.
Throws:
SQLException - if a database error happens

registerOutParameter

void registerOutParameter(java.lang.String parameterName,
                          int sqlType,
                          int scale)
                          throws SQLException
Defines the Type of a specified OUT parameter. All OUT parameters must have their Type defined before a stored procedure is executed. This version of the registerOutParameter method, which has a scale parameter, should be used for the JDBC types NUMERIC and DECIMAL, where there is a need to specify the number of digits expected after the decimal point.

The Type defined by this method fixes the Java type that must be retrieved using the getter methods of CallableStatement.

Parameters:
parameterName - the parameter name
sqlType - a JDBC type expressed as a constant from Types
scale - the number of digits after the decimal point. Must be greater than or equal to 0.
Throws:
SQLException - if a database error happens

registerOutParameter

void registerOutParameter(java.lang.String parameterName,
                          int sqlType,
                          java.lang.String typeName)
                          throws SQLException
Defines the Type of a specified OUT parameter. This variant of the method is designed for use with parameters that are User Defined Types (UDT) or a REF type, although it can be used for any type.Registers the designated output parameter.

Parameters:
parameterName - the parameter name
sqlType - a JDBC type expressed as a constant from Types
typeName - the fully qualified name of an SQL structured type. For a REF type, this name should be the fully qualified name of the referenced type.
Throws:
SQLException - if a database error happens

setAsciiStream

void setAsciiStream(java.lang.String parameterName,
                    java.io.InputStream theInputStream,
                    int length)
                    throws SQLException
Sets the value of a specified parameter to the content of a supplied InputStream, which has a specified number of bytes.

This is a good method for setting an SQL LONVARCHAR parameter where the length of the data is large. Data is read from the InputStream until end-of-file is reached or the specified number of bytes is copied.

Parameters:
parameterName - the parameter name
theInputStream - the ASCII InputStream carrying the data to update the parameter with
length - the number of bytes in the InputStream to copy to the parameter
Throws:
SQLException - if a database error happens

setBinaryStream

void setBinaryStream(java.lang.String parameterName,
                     java.io.InputStream theInputStream,
                     int length)
                     throws SQLException
Sets the value of a specified parameter to the content of a supplied binary InputStream, which has a specified number of bytes.

Use this method when a large amount of data needs to be set into a LONGVARBINARY parameter.

Parameters:
parameterName - the name of the parameter
theInputStream - the binary InputStream carrying the data to update the parameter
length - the number of bytes in the InputStream to copy to the parameter
Throws:
SQLException - if a database error happens

setBoolean

void setBoolean(java.lang.String parameterName,
                boolean theBoolean)
                throws SQLException
Sets the value of a specified parameter to a supplied boolean value.

Parameters:
parameterName - the parameter name
theBoolean - the new value with which to update the parameter
Throws:
SQLException - if a database error happens

setByte

void setByte(java.lang.String parameterName,
             byte theByte)
             throws SQLException
Sets the value of a specified parameter to a supplied byte value.

Parameters:
parameterName - the parameter name
theByte - the new value with which to update the parameter
Throws:
SQLException - if a database error happens

setBytes

void setBytes(java.lang.String parameterName,
              byte[] theBytes)
              throws SQLException
Sets the value of a specified parameter to a supplied array of bytes. The array is mapped to VARBINARY or else LONGVARBINARY in the connected database.

Parameters:
parameterName - the parameter name
theBytes - the new value with which to update the parameter
Throws:
SQLException - if a database error happens

setCharacterStream

void setCharacterStream(java.lang.String parameterName,
                        java.io.Reader reader,
                        int length)
                        throws SQLException
Sets the value of a specified parameter to the character content of a Reader object, with the specified length of character data.

Parameters:
parameterName - the parameter name
reader - the new value with which to update the parameter
length - a count of the characters contained in reader
Throws:
SQLException - if a database error happens

setDate

void setDate(java.lang.String parameterName,
             Date theDate)
             throws SQLException
Sets the value of a specified parameter to a supplied java.sql.Date value.

Parameters:
parameterName - the parameter name
theDate - the new value with which to update the parameter
Throws:
SQLException - if a database error happens

setDate

void setDate(java.lang.String parameterName,
             Date theDate,
             java.util.Calendar cal)
             throws SQLException
Sets the value of a specified parameter to a supplied java.sql.Date value, using a supplied Calendar to map the Date. The Calendar allows the application to control the timezone used to compute the SQL DATE in the database - without the supplied Calendar, the driver uses the default timezone of the Java virtual machine.

Parameters:
parameterName - the parameter name
theDate - the new value with which to update the parameter
cal - a Calendar to use to construct the SQL DATE value
Throws:
SQLException - if a database error happens

setDouble

void setDouble(java.lang.String parameterName,
               double theDouble)
               throws SQLException
Sets the value of a specified parameter to a supplied double value.

Parameters:
parameterName - the parameter name
theDouble - the new value with which to update the parameter
Throws:
SQLException - if a database error happens

setFloat

void setFloat(java.lang.String parameterName,
              float theFloat)
              throws SQLException
Sets the value of a specified parameter to to a supplied float value.

Parameters:
parameterName - the parameter name
theFloat - the new value with which to update the parameter
Throws:
SQLException - if a database error happens

setInt

void setInt(java.lang.String parameterName,
            int theInt)
            throws SQLException
Sets the value of a specified parameter to a supplied int value.

Parameters:
parameterName - the parameter name
theInt - the new value with which to update the parameter
Throws:
SQLException - if a database error happens

setLong

void setLong(java.lang.String parameterName,
             long theLong)
             throws SQLException
Sets the value of a specified parameter to a supplied long value.

Parameters:
parameterName - the parameter name
theLong - the new value with which to update the parameter
Throws:
SQLException - if a database error happens

setNull

void setNull(java.lang.String parameterName,
             int sqlType)
             throws SQLException
Sets the value of a specified parameter to SQL NULL. Don't use this version of setNull for User Defined Types or for REF type parameters.

Parameters:
parameterName - the parameter name
sqlType - a JDBC type expressed as a constant from Types
Throws:
SQLException - if a database error happens

setNull

void setNull(java.lang.String parameterName,
             int sqlType,
             java.lang.String typeName)
             throws SQLException
Sets the value of a specified parameter to be SQL NULL where the parameter type is either REF or user defined (e.g. STRUCT, JAVA_OBJECT etc).

For reasons of portability, the caller is expected to supply both the SQL Type code and Type name (which is just the parameter name if the type is user defined, or the name of the type being referenced if a REF).

Parameters:
parameterName - the parameter name
sqlType - a JDBC type expressed as a constant from Types
typeName - if the target parameter is a user defined type then this should contain the full type name the fully qualified name of a UDT or REF type - ignored if the parameter is not a UDT.
Throws:
SQLException - if a database error happens

setObject

void setObject(java.lang.String parameterName,
               java.lang.Object theObject)
               throws SQLException
Sets the value of a specified parameter using a supplied object. Prior to issuing this request to the connected database theObject is transformed to the corresponding SQL type according to the normal Java to SQL mapping rules.

If the object's class implements the interface SQLData, the JDBC driver calls SQLData.writeSQL to write it to the SQL data stream. If theObject implements any of the following interfaces then it is the role of the driver to flow the value to the connected database using the appropriate SQL type :

Parameters:
parameterName - the parameter name
theObject - the new value with which to update the parameter
Throws:
SQLException - if a database error happens

setObject

void setObject(java.lang.String parameterName,
               java.lang.Object theObject,
               int targetSqlType)
               throws SQLException
Sets the value of a specified parameter using a supplied object.

The Object is converted to the given targetSqlType before it is sent to the database. If the object has a custom mapping (its class implements the interface SQLData), the JDBC driver will call the method SQLData.writeSQL to write it to the SQL data stream. If theObject implements any of the following interfaces then it is the role of the driver to flow the value to the connected database using the appropriate SQL type :

Parameters:
parameterName - the parameter name
theObject - the new value with which to update the parameter
targetSqlType - a JDBC type expressed as a constant from Types
Throws:
SQLException - if a database error happens

setObject

void setObject(java.lang.String parameterName,
               java.lang.Object theObject,
               int targetSqlType,
               int scale)
               throws SQLException
Sets the value of a specified parameter using a supplied object.

The Object is converted to the given targetSqlType before it is sent to the database. If the object has a custom mapping (its class implements the interface SQLData), the JDBC driver will call the method SQLData.writeSQL to write it to the SQL data stream. If theObject implements any of the following interfaces then it is the role of the driver to flow the value to the connected database using the appropriate SQL type :

Parameters:
parameterName - the parameter name
theObject - the new value with which to update the parameter
targetSqlType - a JDBC type expressed as a constant from Types
scale - where applicable, the number of digits after the decimal point.
Throws:
SQLException - if a database error happens

setShort

void setShort(java.lang.String parameterName,
              short theShort)
              throws SQLException
Sets the value of a specified parameter to a supplied short value.

Parameters:
parameterName - the name of the parameter
theShort - a short value to update the parameter
Throws:
SQLException - if a database error happens

setString

void setString(java.lang.String parameterName,
               java.lang.String theString)
               throws SQLException
Sets the value of a specified parameter to a supplied String.

Parameters:
parameterName - the name of the parameter
theString - a String value to update the parameter
Throws:
SQLException - if a database error happens

setTime

void setTime(java.lang.String parameterName,
             Time theTime)
             throws SQLException
Sets the value of the parameter named parameterName to the value of the supplied java.sql.Time.

Parameters:
parameterName - the parameter name
theTime - the new value with which to update the parameter
Throws:
SQLException - if a database error happens

setTime

void setTime(java.lang.String parameterName,
             Time theTime,
             java.util.Calendar cal)
             throws SQLException
Sets the value of the parameter named parameterName to the value of the supplied java.sql.Time using the supplied Calendar.

The driver uses the supplied Calendar to create the SQL TIME value, which allows it to use a custom timezone - otherwise the driver uses the default timezone of the Java virtual machine.

Parameters:
parameterName - the parameter name
theTime - the new value with which to update the parameter
cal - used for creating the new SQL TIME value
Throws:
SQLException - if a database error happens

setTimestamp

void setTimestamp(java.lang.String parameterName,
                  Timestamp theTimestamp)
                  throws SQLException
Sets the value of a specified parameter to a supplied java.sql.Timestamp value.

Parameters:
parameterName - the parameter name
theTimestamp - the new value with which to update the parameter
Throws:
SQLException - if a database error happens

setTimestamp

void setTimestamp(java.lang.String parameterName,
                  Timestamp theTimestamp,
                  java.util.Calendar cal)
                  throws SQLException
Sets the value of a specified parameter to a supplied java.sql.Timestamp value, using the supplied Calendar.

The driver uses the supplied Calendar to create the SQL TIMESTAMP value, which allows it to use a custom timezone - otherwise the driver uses the default timezone of the Java virtual machine.

Parameters:
parameterName - the parameter name
theTimestamp - the new value with which to update the parameter
cal - used for creating the new SQL TIME value
Throws:
SQLException - if a database error happens

wasNull

boolean wasNull()
                throws SQLException
Gets whether the value of the last OUT parameter read was SQL NULL.

Returns:
true if the last parameter was SQL NULL, false otherwise.
Throws:
SQLException - if a database error happens

Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

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