com.ibm.as400.access
Class AS400JDBCCallableStatement

java.lang.Object
  |
  +--com.ibm.as400.access.AS400JDBCStatement
        |
        +--com.ibm.as400.access.AS400JDBCPreparedStatement
              |
              +--com.ibm.as400.access.AS400JDBCCallableStatement
All Implemented Interfaces:
java.sql.CallableStatement, java.sql.PreparedStatement, java.sql.Statement

public class AS400JDBCCallableStatement
extends AS400JDBCPreparedStatement
implements java.sql.CallableStatement

The AS400JDBCCallableStatement class runs a stored procedure. Use Connection.prepareCall() to create new CallableStatement objects.

Parameters are indexed sequentially, by number, starting at 1. The caller must register output parameters before executing the stored procedure.

The new JDK 1.4 methods add the ability to retrieve information by column name in addition to column index. Be aware you will see better performance accessing columns by their index rather than accessing them by their name.


Method Summary
 java.sql.Array getArray(int parameterIndex)
          Returns the value of an SQL ARRAY output parameter as an Array value.
 java.sql.Array getArray(java.lang.String parameterName)
          Returns the value of an SQL ARRAY output parameter as an Array value.
 java.math.BigDecimal getBigDecimal(int parameterIndex)
          Returns the value of an SQL NUMERIC or DECIMAL output parameter as a BigDecimal object.
 java.math.BigDecimal getBigDecimal(int parameterIndex, int scale)
          Deprecated. Use getBigDecimal(int) or getBigDecimal(String) instead.
 java.math.BigDecimal getBigDecimal(java.lang.String parameterName)
          Returns the value of an SQL NUMERIC or DECIMAL output parameter as a BigDecimal object.
 java.sql.Blob getBlob(int parameterIndex)
          Returns the value of an SQL BLOB output parameter as a Blob value.
 java.sql.Blob getBlob(java.lang.String parameterName)
          Returns the value of an SQL BLOB output parameter as a Blob value.
 boolean getBoolean(int parameterIndex)
          Returns the value of an SQL SMALLINT output parameter as a Java boolean.
 boolean getBoolean(java.lang.String parameterName)
          Returns the value of an SQL SMALLINT output parameter as a Java boolean.
 byte getByte(int parameterIndex)
          Returns the value of an SQL SMALLINT output parameter as a Java byte.
 byte getByte(java.lang.String parameterName)
          Returns the value of an SQL SMALLINT output parameter as a Java byte.
 byte[] getBytes(int parameterIndex)
          Returns the value of an SQL BINARY or VARBINARY output parameter as a Java byte array.
 byte[] getBytes(java.lang.String parameterName)
          Returns the value of an SQL BINARY or VARBINARY output parameter as a Java byte array.
 java.sql.Clob getClob(int parameterIndex)
          Returns the value of an SQL CLOB output parameter as a Clob value.
 java.sql.Clob getClob(java.lang.String parameterName)
          Returns the value of an SQL CLOB output parameter as a Clob value.
 java.sql.Date getDate(int parameterIndex)
          Returns the value of an SQL DATE output parameter as a java.sql.Date object using the default calendar.
 java.sql.Date getDate(int parameterIndex, java.util.Calendar calendar)
          Returns the value of an SQL DATE output parameter as a java.sql.Date object using a calendar other than the default.
 java.sql.Date getDate(java.lang.String parameterName)
          Returns the value of an SQL DATE output parameter as a java.sql.Date object using the default calendar.
 java.sql.Date getDate(java.lang.String parameterName, java.util.Calendar calendar)
          Returns the value of an SQL DATE output parameter as a java.sql.Date object using a calendar other than the default.
 double getDouble(int parameterIndex)
          Returns the value of an SQL DOUBLE or FLOAT output parameter as a Java double.
 double getDouble(java.lang.String parameterName)
          Returns the value of an SQL DOUBLE or FLOAT output parameter as a Java double.
 float getFloat(int parameterIndex)
          Returns the value of an SQL REAL or FLOAT output parameter as a Java float.
 float getFloat(java.lang.String parameterName)
          Returns the value of an SQL REAL or FLOAT output parameter as a Java float.
 int getInt(int parameterIndex)
          Returns the value of an SQL INTEGER output parameter as a Java int.
 int getInt(java.lang.String parameterName)
          Returns the value of an SQL INTEGER output parameter as a Java int.
 long getLong(int parameterIndex)
          If the connected AS/400 or iSeries server supports SQL BIGINT data, this returns the value of an SQL BIGINT output parameter as a Java long.
 long getLong(java.lang.String parameterName)
          If the connected AS/400 or iSeries server supports SQL BIGINT data, this returns the value of an SQL BIGINT output parameter as a Java long.
 java.lang.Object getObject(int parameterIndex)
          Returns the value of an output parameter as a Java Object.
 java.lang.Object getObject(int parameterIndex, java.util.Map typeMap)
          Returns the value of an output parameter as a Java Object.
 java.lang.Object getObject(java.lang.String parameterName)
          Returns the value of an output parameter as a Java Object.
 java.lang.Object getObject(java.lang.String parameterName, java.util.Map typeMap)
          Returns the value of an output parameter as a Java Object.
 java.sql.Ref getRef(int parameterIndex)
          Returns the value of an SQL REF output parameter as a Ref value.
 java.sql.Ref getRef(java.lang.String parameterName)
          Returns the value of an SQL REF output parameter as a Ref value.
 short getShort(int parameterIndex)
          Returns the value of an SQL SMALLINT output parameter as a Java short value.
 short getShort(java.lang.String parameterName)
          Returns the value of an SQL SMALLINT output parameter as a Java short value.
 java.lang.String getString(int parameterIndex)
          Returns the value of an SQL CHAR or VARCHAR output parameter as a Java String object.
 java.lang.String getString(java.lang.String parameterName)
          Returns the value of an SQL CHAR or VARCHAR output parameter as a Java String object.
 java.sql.Time getTime(int parameterIndex)
          Returns the value of an SQL TIME output parameter as a java.sql.Time object using the default calendar.
 java.sql.Time getTime(int parameterIndex, java.util.Calendar calendar)
          Returns the value of an SQL TIME output parameter as a java.sql.Time object using a calendar other than the default.
 java.sql.Time getTime(java.lang.String parameterName)
          Returns the value of an SQL TIME output parameter as a java.sql.Time object using the default calendar.
 java.sql.Time getTime(java.lang.String parameterName, java.util.Calendar calendar)
          Returns the value of an SQL TIME output parameter as a java.sql.Time object using a calendar other than the default.
 java.sql.Timestamp getTimestamp(int parameterIndex)
          Returns the value of an SQL TIMESTAMP output parameter as a java.sql.Timestamp object using the default calendar.
 java.sql.Timestamp getTimestamp(int parameterIndex, java.util.Calendar calendar)
          Returns the value of an SQL TIMESTAMP output parameter as a java.sql.Timestamp object using a calendar other than the default.
 java.sql.Timestamp getTimestamp(java.lang.String parameterName)
          Returns the value of an SQL TIMESTAMP output parameter as a java.sql.Timestamp object using the default calendar.
 java.sql.Timestamp getTimestamp(java.lang.String parameterName, java.util.Calendar calendar)
          Returns the value of an SQL TIMESTAMP output parameter as a java.sql.Timestamp object using a calendar other than the default.
 java.net.URL getURL(int parameterIndex)
          Returns the value of an SQL DATALINK output parameter as a java.net.URL object.
 java.net.URL getURL(java.lang.String parameterName)
          Returns the value of an SQL DATALINK output parameter as a java.net.URL object.
 void registerOutParameter(int parameterIndex, int sqlType)
          Registers the type for an output parameter.
 void registerOutParameter(int parameterIndex, int sqlType, int scale)
          Registers the type for an output parameter.
 void registerOutParameter(int parameterIndex, int sqlType, java.lang.String typeName)
          Registers the type for an output parameter.
 void registerOutParameter(java.lang.String parameterName, int sqlType)
          Registers the type for an output parameter.
 void registerOutParameter(java.lang.String parameterName, int sqlType, int scale)
          Registers the type for an output parameter.
 void registerOutParameter(java.lang.String parameterName, int sqlType, java.lang.String typeName)
          Registers the type for an output parameter.
 void setAsciiStream(java.lang.String parameterName, java.io.InputStream parameterValue, int length)
          Sets an input parameter to an ASCII stream value.
 void setBigDecimal(java.lang.String parameterName, java.math.BigDecimal parameterValue)
          Sets an input parameter to a BigDecimal value.
 void setBinaryStream(java.lang.String parameterName, java.io.InputStream parameterValue, int length)
          Sets an input parameter to a binary stream value.
 void setBoolean(java.lang.String parameterName, boolean parameterValue)
          Sets an input parameter to a Java boolean value.
 void setByte(java.lang.String parameterName, byte parameterValue)
          Sets an input parameter to a Java byte value.
 void setBytes(java.lang.String parameterName, byte[] parameterValue)
          Sets an input parameter to a Java byte array value.
 void setCharacterStream(java.lang.String parameterName, java.io.Reader parameterValue, int length)
          Sets an input parameter to a character stream value.
 void setDate(java.lang.String parameterName, java.sql.Date parameterValue)
          Sets an input parameter to a java.sql.Date value using the default calendar.
 void setDate(java.lang.String parameterName, java.sql.Date parameterValue, java.util.Calendar cal)
          Sets an input parameter to a java.sql.Date value using a calendar other than the default.
 void setDouble(java.lang.String parameterName, double parameterValue)
          Sets an input parameter to a Java double value.
 void setFloat(java.lang.String parameterName, float parameterValue)
          Sets an input parameter to a Java float value.
 void setInt(java.lang.String parameterName, int parameterValue)
          Sets an input parameter to a Java int value.
 void setLong(java.lang.String parameterName, long parameterValue)
          Sets an input parameter to a Java long value.
 void setNull(java.lang.String parameterName, int sqlType)
          Sets an input parameter to SQL NULL.
 void setNull(java.lang.String parameterName, int sqlType, java.lang.String typeName)
          Sets an input parameter to SQL NULL.
 void setObject(java.lang.String parameterName, java.lang.Object parameterValue)
          Sets an input parameter to an Object value.
 void setObject(java.lang.String parameterName, java.lang.Object parameterValue, int targetSqlType)
          Sets an input parameter to an Object value.
 void setObject(java.lang.String parameterName, java.lang.Object parameterValue, int targetSqlType, int scale)
          Sets an input parameter to an Object value.
 void setShort(java.lang.String parameterName, short parameterValue)
          Sets an input parameter to a Java short value.
 void setString(java.lang.String parameterName, java.lang.String parameterValue)
          Sets an input parameter to a String value.
 void setTime(java.lang.String parameterName, java.sql.Time parameterValue)
          Sets an input parameter to a java.sql.Time value using the default calendar.
 void setTime(java.lang.String parameterName, java.sql.Time parameterValue, java.util.Calendar cal)
          Sets an input parameter to a java.sql.Time value using a calendar other than the default.
 void setTimestamp(java.lang.String parameterName, java.sql.Timestamp parameterValue)
          Sets an input parameter to a java.sql.Timestamp value using the default calendar.
 void setTimestamp(java.lang.String parameterName, java.sql.Timestamp parameterValue, java.util.Calendar cal)
          Sets an input parameter to a java.sql.Timestamp value using a calendar other than the default.
 void setURL(java.lang.String parameterName, java.net.URL parameterValue)
          Sets an input parameter to a URL value.
 boolean wasNull()
          Indicates if the last parameter read has the value of SQL NULL.
 
Methods inherited from class com.ibm.as400.access.AS400JDBCPreparedStatement
addBatch, addBatch, clearParameters, close, execute, execute, execute, executeBatch, executeQuery, executeQuery, executeUpdate, executeUpdate, 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 class com.ibm.as400.access.AS400JDBCStatement
cancel, clearBatch, clearWarnings, execute, execute, executeUpdate, executeUpdate, finalize, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setQueryTimeout, toString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.sql.PreparedStatement
addBatch, clearParameters, execute, executeQuery, executeUpdate, getMetaData, 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
 
Methods inherited from interface java.sql.Statement
addBatch, cancel, clearBatch, clearWarnings, close, execute, executeBatch, executeQuery, executeUpdate, getConnection, getFetchDirection, getFetchSize, getMaxFieldSize, getMaxRows, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetType, getUpdateCount, getWarnings, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setQueryTimeout
 

Method Detail

getArray

public java.sql.Array getArray(int parameterIndex)
                        throws java.sql.SQLException
Returns the value of an SQL ARRAY output parameter as an Array value. DB2 UDB for iSeries does not support arrays.
Specified by:
getArray in interface java.sql.CallableStatement
Parameters:
parameterIndex - The parameter index (1-based).
Returns:
The parameter value or 0 if the value is SQL NULL.
Throws:
java.sql.SQLException - Always thrown because DB2 UDB for iSeries does not support arrays.

getArray

public java.sql.Array getArray(java.lang.String parameterName)
                        throws java.sql.SQLException
Returns the value of an SQL ARRAY output parameter as an Array value. DB2 UDB for iSeries does not support arrays.
Parameters:
parameterName - The parameter name.
Returns:
The parameter value or 0 if the value is SQL NULL.
Throws:
java.sql.SQLException - Always thrown because DB2 UDB for iSeries does not support arrays.
Since:
Modification 5

getBigDecimal

public java.math.BigDecimal getBigDecimal(int parameterIndex)
                                   throws java.sql.SQLException
Returns the value of an SQL NUMERIC or DECIMAL output parameter as a BigDecimal object.
Specified by:
getBigDecimal in interface java.sql.CallableStatement
Parameters:
parameterIndex - The parameter index (1-based).
Returns:
The parameter value or null if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the index is not registered as an output parameter, the statement was not executed, or the requested conversion is not valid.

getBigDecimal

public java.math.BigDecimal getBigDecimal(int parameterIndex,
                                          int scale)
                                   throws java.sql.SQLException
Deprecated. Use getBigDecimal(int) or getBigDecimal(String) instead.

Returns the value of an SQL NUMERIC or DECIMAL output parameter as a BigDecimal object.
Specified by:
getBigDecimal in interface java.sql.CallableStatement
Parameters:
parameterIndex - The parameter index (1-based).
scale - The number of digits after the decimal.
Returns:
The parameter value or null if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the index is not registered as an output parameter, the scale is not valid, the statement was not executed, or the requested conversion is not valid.
See Also:
getBigDecimal(int)

getBigDecimal

public java.math.BigDecimal getBigDecimal(java.lang.String parameterName)
                                   throws java.sql.SQLException
Returns the value of an SQL NUMERIC or DECIMAL output parameter as a BigDecimal object.
Parameters:
parameterName - The parameter name.
Returns:
The parameter value or null if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the parameter name is not registered as an output parameter, the statement was not executed, or the requested conversion is not valid.
Since:
Modification 5

getBlob

public java.sql.Blob getBlob(int parameterIndex)
                      throws java.sql.SQLException
Returns the value of an SQL BLOB output parameter as a Blob value.
Specified by:
getBlob in interface java.sql.CallableStatement
Parameters:
parameterIndex - The parameter index (1-based).
Returns:
The parameter value or 0 if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the index is not registered as an output parameter, the statement was not executed, or the requested conversion is not valid.

getBlob

public java.sql.Blob getBlob(java.lang.String parameterName)
                      throws java.sql.SQLException
Returns the value of an SQL BLOB output parameter as a Blob value.
Parameters:
parameterName - The parameter name.
Returns:
The parameter value or 0 if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the parameter name is not registered as an output parameter, the statement was not executed, or the requested conversion is not valid.
Since:
Modification 5

getBoolean

public boolean getBoolean(int parameterIndex)
                   throws java.sql.SQLException
Returns the value of an SQL SMALLINT output parameter as a Java boolean.
Specified by:
getBoolean in interface java.sql.CallableStatement
Parameters:
parameterIndex - The parameter index (1-based).
Returns:
The parameter value or false if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the index is not registered as an output parameter, the statement was not executed, or the requested conversion is not valid.

getBoolean

public boolean getBoolean(java.lang.String parameterName)
                   throws java.sql.SQLException
Returns the value of an SQL SMALLINT output parameter as a Java boolean.
Parameters:
parameterName - The parameter name.
Returns:
The parameter value or false if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the index is not registered as an output parameter, the statement was not executed, or the requested conversion is not valid.
Since:
Modification 5

getByte

public byte getByte(int parameterIndex)
             throws java.sql.SQLException
Returns the value of an SQL SMALLINT output parameter as a Java byte.
Specified by:
getByte in interface java.sql.CallableStatement
Parameters:
parameterIndex - The parameter index (1-based).
Returns:
The parameter value or 0 if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the index is not registered as an output parameter, the statement was not executed, or the requested conversion is not valid, or an error occurs.

getByte

public byte getByte(java.lang.String parameterName)
             throws java.sql.SQLException
Returns the value of an SQL SMALLINT output parameter as a Java byte.
Parameters:
parameterName - The parameter name.
Returns:
The parameter value or 0 if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the index is not registered as an output parameter, the statement was not executed, or the requested conversion is not valid, or an error occurs.
Since:
Modification 5

getBytes

public byte[] getBytes(int parameterIndex)
                throws java.sql.SQLException
Returns the value of an SQL BINARY or VARBINARY output parameter as a Java byte array.
Specified by:
getBytes in interface java.sql.CallableStatement
Parameters:
parameterIndex - The parameter index (1-based).
Returns:
The parameter value or null if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the index is not registered as an output parameter, the statement was not executed, or the requested conversion is not valid.

getBytes

public byte[] getBytes(java.lang.String parameterName)
                throws java.sql.SQLException
Returns the value of an SQL BINARY or VARBINARY output parameter as a Java byte array.
Parameters:
parameterName - The parameter name.
Returns:
The parameter value or null if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the index is not registered as an output parameter, the statement was not executed, or the requested conversion is not valid.
Since:
Modification 5

getClob

public java.sql.Clob getClob(int parameterIndex)
                      throws java.sql.SQLException
Returns the value of an SQL CLOB output parameter as a Clob value.
Specified by:
getClob in interface java.sql.CallableStatement
Parameters:
parameterIndex - The parameter index (1-based).
Returns:
The parameter value or 0 if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the index is not registered as an output parameter, the statement was not executed, or the requested conversion is not valid.

getClob

public java.sql.Clob getClob(java.lang.String parameterName)
                      throws java.sql.SQLException
Returns the value of an SQL CLOB output parameter as a Clob value.
Parameters:
parameterName - The parameter name.
Returns:
The parameter value or 0 if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the index is not registered as an output parameter, the statement was not executed, or the requested conversion is not valid.
Since:
Modification 5

getDate

public java.sql.Date getDate(int parameterIndex)
                      throws java.sql.SQLException
Returns the value of an SQL DATE output parameter as a java.sql.Date object using the default calendar.
Specified by:
getDate in interface java.sql.CallableStatement
Parameters:
parameterIndex - The parameter index (1-based).
Returns:
The parameter value or null if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the index is not registered as an output parameter, the statement was not executed, or the requested conversion is not valid.

getDate

public java.sql.Date getDate(int parameterIndex,
                             java.util.Calendar calendar)
                      throws java.sql.SQLException
Returns the value of an SQL DATE output parameter as a java.sql.Date object using a calendar other than the default.
Specified by:
getDate in interface java.sql.CallableStatement
Parameters:
parameterIndex - The parameter index (1-based).
calendar - The calendar.
Returns:
The parameter value or null if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the index is not registered as an output parameter, the statement was not executed, the calendar is null, or the requested conversion is not valid.

getDate

public java.sql.Date getDate(java.lang.String parameterName)
                      throws java.sql.SQLException
Returns the value of an SQL DATE output parameter as a java.sql.Date object using the default calendar.
Parameters:
parameterName - The parameter name.
Returns:
The parameter value or null if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the parameter name is not registered as an output parameter, the statement was not executed, or the requested conversion is not valid.
Since:
Modification 5

getDate

public java.sql.Date getDate(java.lang.String parameterName,
                             java.util.Calendar calendar)
                      throws java.sql.SQLException
Returns the value of an SQL DATE output parameter as a java.sql.Date object using a calendar other than the default.
Parameters:
parameterName - The parameter name.
calendar - The calendar.
Returns:
The parameter value or null if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the parameter name is not registered as an output parameter, the statement was not executed, the calendar is null, or the requested conversion is not valid.

getDouble

public double getDouble(int parameterIndex)
                 throws java.sql.SQLException
Returns the value of an SQL DOUBLE or FLOAT output parameter as a Java double.
Specified by:
getDouble in interface java.sql.CallableStatement
Parameters:
parameterIndex - The parameter index (1-based).
Returns:
The parameter value or 0 if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the index is not registered as an output parameter, the statement was not executed, or the requested conversion is not valid.

getDouble

public double getDouble(java.lang.String parameterName)
                 throws java.sql.SQLException
Returns the value of an SQL DOUBLE or FLOAT output parameter as a Java double.
Parameters:
parameterName - The parameter name.
Returns:
The parameter value or 0 if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the index is not registered as an output parameter, the statement was not executed, or the requested conversion is not valid.
Since:
Modification 5

getFloat

public float getFloat(int parameterIndex)
               throws java.sql.SQLException
Returns the value of an SQL REAL or FLOAT output parameter as a Java float.
Specified by:
getFloat in interface java.sql.CallableStatement
Parameters:
parameterIndex - The parameter index (1-based).
Returns:
The parameter value or 0 if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the index is not registered as an output parameter, the statement was not executed, or the requested conversion is not valid.

getFloat

public float getFloat(java.lang.String parameterName)
               throws java.sql.SQLException
Returns the value of an SQL REAL or FLOAT output parameter as a Java float.
Parameters:
parameterName - The parameter name.
Returns:
The parameter value or 0 if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the index is not registered as an output parameter, the statement was not executed, or the requested conversion is not valid.
Since:
Modification 5

getInt

public int getInt(int parameterIndex)
           throws java.sql.SQLException
Returns the value of an SQL INTEGER output parameter as a Java int.
Specified by:
getInt in interface java.sql.CallableStatement
Parameters:
parameterIndex - The parameter index (1-based).
Returns:
The parameter value or 0 if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the index is not registered as an output parameter, the statement was not executed, or the requested conversion is not valid.

getInt

public int getInt(java.lang.String parameterName)
           throws java.sql.SQLException
Returns the value of an SQL INTEGER output parameter as a Java int.
Parameters:
parameterName - The parameter name.
Returns:
The parameter value or 0 if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the index is not registered as an output parameter, the statement was not executed, or the requested conversion is not valid.
Since:
Modification 5

getLong

public long getLong(int parameterIndex)
             throws java.sql.SQLException
If the connected AS/400 or iSeries server supports SQL BIGINT data, this returns the value of an SQL BIGINT output parameter as a Java long. Otherwise, this returns the value of an SQL INTEGER output parameter as a Java long. SQL BIGINT data is supported on V4R5 and later.
Specified by:
getLong in interface java.sql.CallableStatement
Parameters:
parameterIndex - The parameter index (1-based).
Returns:
The parameter value or 0 if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the index is not registered as an output parameter, the statement was not executed, or the requested conversion is not valid.

getLong

public long getLong(java.lang.String parameterName)
             throws java.sql.SQLException
If the connected AS/400 or iSeries server supports SQL BIGINT data, this returns the value of an SQL BIGINT output parameter as a Java long. Otherwise, this returns the value of an SQL INTEGER output parameter as a Java long. SQL BIGINT data is supported on V4R5 and later.
Parameters:
parameterName - The parameter name.
Returns:
The parameter value or 0 if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the index is not registered as an output parameter, the statement was not executed, or the requested conversion is not valid.
Since:
Modification 5

getObject

public java.lang.Object getObject(int parameterIndex)
                           throws java.sql.SQLException
Returns the value of an output parameter as a Java Object. The type of the object corresponds to the SQL type that was registered for this parameter using registerOutParameter(). When the parameter is a user-defined type, then the connection's type map is used to create the object.
Specified by:
getObject in interface java.sql.CallableStatement
Parameters:
parameterIndex - The parameter index (1-based).
Returns:
The parameter value or null if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the index is not registered as an output parameter, the statement was not executed, or the requested conversion is not valid.

getObject

public java.lang.Object getObject(int parameterIndex,
                                  java.util.Map typeMap)
                           throws java.sql.SQLException
Returns the value of an output parameter as a Java Object. This driver does not support the type map.
Specified by:
getObject in interface java.sql.CallableStatement
Parameters:
parameterIndex - The parameter index (1-based).
type - The type map. This is not used.
Returns:
The parameter value or null if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the index is not registered as an output parameter, the statement was not executed, or the requested conversion is not valid.

getObject

public java.lang.Object getObject(java.lang.String parameterName)
                           throws java.sql.SQLException
Returns the value of an output parameter as a Java Object. The type of the object corresponds to the SQL type that was registered for this parameter using registerOutParameter(). When the parameter is a user-defined type, then the connection's type map is used to create the object.
Parameters:
parameterName - The parameter name.
Returns:
The parameter value or null if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the parameter name is not registered as an output parameter, the statement was not executed, or the requested conversion is not valid.
Since:
Modification 5

getObject

public java.lang.Object getObject(java.lang.String parameterName,
                                  java.util.Map typeMap)
                           throws java.sql.SQLException
Returns the value of an output parameter as a Java Object. This driver does not support the type map.
Parameters:
parameterName - The parameter name.
type - The type map. This is not used.
Returns:
The parameter value or null if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the index is not registered as an output parameter, the statement was not executed, or the requested conversion is not valid.
Since:
Modification 5

getRef

public java.sql.Ref getRef(int parameterIndex)
                    throws java.sql.SQLException
Returns the value of an SQL REF output parameter as a Ref value. DB2 UDB for iSeries does not support structured types.
Specified by:
getRef in interface java.sql.CallableStatement
Parameters:
parameterIndex - The parameter index (1-based).
Returns:
The parameter value or 0 if the value is SQL NULL.
Throws:
java.sql.SQLException - Always thrown because DB2 UDB for iSeries does not support REFs.

getRef

public java.sql.Ref getRef(java.lang.String parameterName)
                    throws java.sql.SQLException
Returns the value of an SQL REF output parameter as a Ref value. DB2 UDB for iSeries does not support structured types.
Parameters:
parameterName - The parameter name.
Returns:
The parameter value or 0 if the value is SQL NULL.
Throws:
java.sql.SQLException - Always thrown because DB2 UDB for iSeries does not support REFs.
Since:
Modification 5

getShort

public short getShort(int parameterIndex)
               throws java.sql.SQLException
Returns the value of an SQL SMALLINT output parameter as a Java short value.
Specified by:
getShort in interface java.sql.CallableStatement
Parameters:
parameterIndex - The parameter index (1-based).
Returns:
The parameter value or 0 if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the index is not registered as an output parameter, the statement was not executed, or the requested conversion is not valid.

getShort

public short getShort(java.lang.String parameterName)
               throws java.sql.SQLException
Returns the value of an SQL SMALLINT output parameter as a Java short value.
Parameters:
parameterName - The parameter name.
Returns:
The parameter value or 0 if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the index is not registered as an output parameter, the statement was not executed, or the requested conversion is not valid.
Since:
Modification 5

getString

public java.lang.String getString(int parameterIndex)
                           throws java.sql.SQLException
Returns the value of an SQL CHAR or VARCHAR output parameter as a Java String object.
Specified by:
getString in interface java.sql.CallableStatement
Parameters:
parameterIndex - The parameter index (1-based).
Returns:
The parameter value or null if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the index is not registered as an output parameter, the statement was not executed, or the requested conversion is not valid.

getString

public java.lang.String getString(java.lang.String parameterName)
                           throws java.sql.SQLException
Returns the value of an SQL CHAR or VARCHAR output parameter as a Java String object.
Parameters:
parameterIndex - The parameter name.
Returns:
The parameter value or null if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the index is not registered as an output parameter, the statement was not executed, or the requested conversion is not valid.
Since:
Modification 5

getTime

public java.sql.Time getTime(int parameterIndex)
                      throws java.sql.SQLException
Returns the value of an SQL TIME output parameter as a java.sql.Time object using the default calendar.
Specified by:
getTime in interface java.sql.CallableStatement
Parameters:
parameterIndex - The parameter index (1-based).
Returns:
The parameter value or null if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the index is not registered as an output parameter, the statement was not executed, or the requested conversion is not valid.

getTime

public java.sql.Time getTime(int parameterIndex,
                             java.util.Calendar calendar)
                      throws java.sql.SQLException
Returns the value of an SQL TIME output parameter as a java.sql.Time object using a calendar other than the default.
Specified by:
getTime in interface java.sql.CallableStatement
Parameters:
parameterIndex - The parameter index (1-based).
calendar - The calendar.
Returns:
The parameter value or null if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the index is not registered as an output parameter, the statement was not executed, the calendar is null, or the requested conversion is not valid.

getTime

public java.sql.Time getTime(java.lang.String parameterName)
                      throws java.sql.SQLException
Returns the value of an SQL TIME output parameter as a java.sql.Time object using the default calendar.
Parameters:
parameterName - The parameter name.
Returns:
The parameter value or null if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the parameter name is not registered as an output parameter, the statement was not executed, or the requested conversion is not valid.
Since:
Modification 5

getTime

public java.sql.Time getTime(java.lang.String parameterName,
                             java.util.Calendar calendar)
                      throws java.sql.SQLException
Returns the value of an SQL TIME output parameter as a java.sql.Time object using a calendar other than the default.
Parameters:
parameterName - The parameter name.
calendar - The calendar.
Returns:
The parameter value or null if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the parameter name is not registered as an output parameter, the statement was not executed, the calendar is null, or the requested conversion is not valid.
Since:
Modification 5

getTimestamp

public java.sql.Timestamp getTimestamp(int parameterIndex)
                                throws java.sql.SQLException
Returns the value of an SQL TIMESTAMP output parameter as a java.sql.Timestamp object using the default calendar.
Specified by:
getTimestamp in interface java.sql.CallableStatement
Parameters:
parameterIndex - The parameter index (1-based).
Returns:
The parameter value or null if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the index is not registered as an output parameter, the statement was not executed, or the requested conversion is not valid.

getTimestamp

public java.sql.Timestamp getTimestamp(int parameterIndex,
                                       java.util.Calendar calendar)
                                throws java.sql.SQLException
Returns the value of an SQL TIMESTAMP output parameter as a java.sql.Timestamp object using a calendar other than the default.
Specified by:
getTimestamp in interface java.sql.CallableStatement
Parameters:
parameterIndex - The parameter index (1-based).
calendar - The calendar.
Returns:
The parameter value or null if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the index is not registered as an output parameter, the statement was not executed, the calendar is null, or the requested conversion is not valid.

getTimestamp

public java.sql.Timestamp getTimestamp(java.lang.String parameterName)
                                throws java.sql.SQLException
Returns the value of an SQL TIMESTAMP output parameter as a java.sql.Timestamp object using the default calendar.
Parameters:
parameterName - The parameter name.
Returns:
The parameter value or null if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the parameter name is not registered as an output parameter, the statement was not executed, or the requested conversion is not valid.
Since:
Modification 5

getTimestamp

public java.sql.Timestamp getTimestamp(java.lang.String parameterName,
                                       java.util.Calendar calendar)
                                throws java.sql.SQLException
Returns the value of an SQL TIMESTAMP output parameter as a java.sql.Timestamp object using a calendar other than the default.
Parameters:
parameterName - The parameter name.
calendar - The calendar.
Returns:
The parameter value or null if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the parameter name is not registered as an output parameter, the statement was not executed, the calendar is null, or the requested conversion is not valid.
Since:
Modification 5

getURL

public java.net.URL getURL(int parameterIndex)
                    throws java.sql.SQLException
Returns the value of an SQL DATALINK output parameter as a java.net.URL object.
Parameters:
parameterIndex - The parameter index (1-based).
Returns:
The parameter value or null if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the parameter name is not registered as an output parameter, the statement was not executed or the requested conversion is not valid.
Since:
Modification 5

getURL

public java.net.URL getURL(java.lang.String parameterName)
                    throws java.sql.SQLException
Returns the value of an SQL DATALINK output parameter as a java.net.URL object.
Parameters:
parameterName - The parameter name.
Returns:
The parameter value or null if the value is SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the name is not valid, the parameter name is not registered as an output parameter, the statement was not executed or the requested conversion is not valid.
Since:
Modification 5

registerOutParameter

public void registerOutParameter(int parameterIndex,
                                 int sqlType,
                                 int scale)
                          throws java.sql.SQLException
Registers the type for an output parameter. Before executing the stored procedure call, explicitly register the type of each output parameter. When reading the value of an output parameter, use a get method that corresponds to the registered type. A parameter that is used for both input and output can not be registered with a different type than was used when it was set.
Specified by:
registerOutParameter in interface java.sql.CallableStatement
Parameters:
parameterIndex - The parameter index (1-based).
sqlType - The SQL type code defined in java.sql.Types.
scale - The number of digits after the decimal if sqlType is DECIMAL or NUMERIC.
Throws:
java.sql.SQLException - If the index is not valid, the scale is not valid, the parameter is not an output parameter, or the requested conversion is not valid.

registerOutParameter

public void registerOutParameter(int parameterIndex,
                                 int sqlType)
                          throws java.sql.SQLException
Registers the type for an output parameter. Before executing the stored procedure call, explicitly register the type of each output parameter. When reading the value of an output parameter, use a get method that corresponds to the registered type. A parameter that is used for both input and output can not be registered with a different type than was used when it was set.
Specified by:
registerOutParameter in interface java.sql.CallableStatement
Parameters:
parameterIndex - The parameter index (1-based).
sqlType - The SQL type code defined in java.sql.Types.
Throws:
java.sql.SQLException - If the index is not valid, the parameter is not an output parameter, or the requested conversion is not valid.

registerOutParameter

public void registerOutParameter(int parameterIndex,
                                 int sqlType,
                                 java.lang.String typeName)
                          throws java.sql.SQLException
Registers the type for an output parameter. Before executing the stored procedure call, explicitly register the type of each output parameter. When reading the value of an output parameter, use a get method that corresponds to the registered type. A parameter that is used for both input and output can not be registered with a different type than was used when it was set.
Specified by:
registerOutParameter in interface java.sql.CallableStatement
Parameters:
parameterIndex - The parameter index (1-based).
sqlType - The SQL type code defined in java.sql.Types.
typeName - The fully-qualified name of an SQL structured type. This value will be ignored.
Throws:
java.sql.SQLException - If the index is not valid, the parameter is not an output parameter, or the requested conversion is not valid.

registerOutParameter

public void registerOutParameter(java.lang.String parameterName,
                                 int sqlType)
                          throws java.sql.SQLException
Registers the type for an output parameter. Before executing the stored procedure call, explicitly register the type of each output parameter. When reading the value of an output parameter, use a get method that corresponds to the registered type. A parameter that is used for both input and output can not be registered with a different type than was used when it was set.
Parameters:
parameterName - The parameter name.
sqlType - The SQL type code defined in java.sql.Types.
Throws:
java.sql.SQLException - If the index is not valid, the parameter is not an output parameter, or the requested conversion is not valid.
Since:
Modification 5

registerOutParameter

public void registerOutParameter(java.lang.String parameterName,
                                 int sqlType,
                                 int scale)
                          throws java.sql.SQLException
Registers the type for an output parameter. Before executing the stored procedure call, explicitly register the type of each output parameter. When reading the value of an output parameter, use a get method that corresponds to the registered type. A parameter that is used for both input and output can not be registered with a different type than was used when it was set.
Parameters:
parameterName - The parameter name.
sqlType - The SQL type code defined in java.sql.Types.
scale - The number of digits after the decimal if sqlType is DECIMAL or NUMERIC.
Throws:
java.sql.SQLException - If the index is not valid, the scale is not valid, the parameter is not an output parameter, or the requested conversion is not valid.
Since:
Modification 5

registerOutParameter

public void registerOutParameter(java.lang.String parameterName,
                                 int sqlType,
                                 java.lang.String typeName)
                          throws java.sql.SQLException
Registers the type for an output parameter. Before executing the stored procedure call, explicitly register the type of each output parameter. When reading the value of an output parameter, use a get method that corresponds to the registered type. A parameter that is used for both input and output can not be registered with a different type than was used when it was set.
Parameters:
parameterName - The parameter name.
sqlType - The SQL type code defined in java.sql.Types.
typeName - The fully-qualified name of an SQL structured type. This value will be ignored.
Throws:
java.sql.SQLException - If the index is not valid, the parameter is not an output parameter, or the requested conversion is not valid.
Since:
Modification 5

setAsciiStream

public void setAsciiStream(java.lang.String parameterName,
                           java.io.InputStream parameterValue,
                           int length)
                    throws java.sql.SQLException
Sets an input parameter to an ASCII stream value. The driver reads the data from the stream as needed until no more bytes are available. The driver converts this to an SQL VARCHAR value.
Parameters:
parameterName - The parameter name.
parameterValue - The parameter value or null to set the value to SQL NULL.
length - The number of bytes in the stream.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the parameter is not an input parameter, the length is not valid, the input stream does not contain all ASCII characters, or an error occurs while reading the input stream.
Since:
Modification 5

setBigDecimal

public void setBigDecimal(java.lang.String parameterName,
                          java.math.BigDecimal parameterValue)
                   throws java.sql.SQLException
Sets an input parameter to a BigDecimal value. The driver converts this to an SQL NUMERIC value.
Parameters:
parameterIndex - The parameter index (1-based).
parameterValue - The parameter value or null to set the value to SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, or the parameter is not an input parameter.
Since:
Modification 5

setBinaryStream

public void setBinaryStream(java.lang.String parameterName,
                            java.io.InputStream parameterValue,
                            int length)
                     throws java.sql.SQLException
Sets an input parameter to a binary stream value. The driver reads the data from the stream as needed until no more bytes are available. The driver converts this to an SQL VARBINARY value.
Parameters:
parameterIndex - The parameter index (1-based).
parameterValue - The parameter value or null to set the value to SQL NULL.
length - The number of bytes in the stream.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the parameter is not an input parameter, the length is not valid, or an error occurs while reading the input stream.
Since:
Modification 5

setBoolean

public void setBoolean(java.lang.String parameterName,
                       boolean parameterValue)
                throws java.sql.SQLException
Sets an input parameter to a Java boolean value. The driver converts this to an SQL SMALLINT value.
Parameters:
parameterName - The parameter name.
parameterValue - The parameter value.
Throws:
java.sql.SQLException - If the statement is not open, the parameterName is not valid, or the parameter is not an input parameter.

setByte

public void setByte(java.lang.String parameterName,
                    byte parameterValue)
             throws java.sql.SQLException
Sets an input parameter to a Java byte value. The driver converts this to an SQL SMALLINT value.
Parameters:
parameterName - The parameter name.
parameterValue - The parameter value.
Throws:
java.sql.SQLException - If the statement is not open, the parameter name is not valid, or the parameter is not an input parameter.
Since:
Modification 5

setBytes

public void setBytes(java.lang.String parameterName,
                     byte[] parameterValue)
              throws java.sql.SQLException
Sets an input parameter to a Java byte array value. The driver converts this to an SQL VARBINARY value.
Parameters:
parameterName - The parameter name.
parameterValue - The parameter value or null to set the value to SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the parameter name is not valid, or the parameter is not an input parameter.
Since:
Modification 5

setCharacterStream

public void setCharacterStream(java.lang.String parameterName,
                               java.io.Reader parameterValue,
                               int length)
                        throws java.sql.SQLException
Sets an input parameter to a character stream value. The driver reads the data from the character stream as needed until no more characters are available. The driver converts this to an SQL VARCHAR value.
Parameters:
parameterName - The parameter name.
parameterValue - The parameter value or null to set the value to SQL NULL.
length - The number of bytes in the reader.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the parameter is not an input parameter, the length is not valid, or an error occurs while reading the character stream
Since:
Modification 5

setDate

public void setDate(java.lang.String parameterName,
                    java.sql.Date parameterValue)
             throws java.sql.SQLException
Sets an input parameter to a java.sql.Date value using the default calendar. The driver converts this to an SQL DATE value.
Parameters:
parameterName - The parameter name.
parameterValue - The parameter value or null to set the value to SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the parameter name is not valid, or the parameter is not an input parameter.
Since:
Modification 5

setDate

public void setDate(java.lang.String parameterName,
                    java.sql.Date parameterValue,
                    java.util.Calendar cal)
             throws java.sql.SQLException
Sets an input parameter to a java.sql.Date value using a calendar other than the default. The driver converts this to an SQL DATE value.
Parameters:
parameterIndex - The parameter index (1-based).
parameterValue - The parameter value or null to set the value to SQL NULL.
calendar - The calendar.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the parameter is not an input parameter, or the calendar is null.
Since:
Modification 5

setDouble

public void setDouble(java.lang.String parameterName,
                      double parameterValue)
               throws java.sql.SQLException
Sets an input parameter to a Java double value. The driver converts this to an SQL DOUBLE value.
Parameters:
parameterName - The parameter name.
parameterValue - The parameter value.
Throws:
java.sql.SQLException - If the statement is not open, the parameter name is not valid or the parameter is not an input parameter.
Since:
Modification 5

setFloat

public void setFloat(java.lang.String parameterName,
                     float parameterValue)
              throws java.sql.SQLException
Sets an input parameter to a Java float value. The driver converts this to an SQL REAL value.
Parameters:
parameterName - The parameter name.
parameterValue - The parameter value.
Throws:
java.sql.SQLException - If the statement is not open, the parameter name is not valid, or the parameter is not an input parameter.
Since:
Modification 5

setInt

public void setInt(java.lang.String parameterName,
                   int parameterValue)
            throws java.sql.SQLException
Sets an input parameter to a Java int value. The driver converts this to an SQL INTEGER value.
Parameters:
parameterName - The parameter name.
parameterValue - The parameter value.
Throws:
java.sql.SQLException - If the statement is not open, the parameter name is not valid or the parameter is not an input parameter.
Since:
Modification 5

setLong

public void setLong(java.lang.String parameterName,
                    long parameterValue)
             throws java.sql.SQLException
Sets an input parameter to a Java long value. If the connected AS/400 or iSeries server supports SQL BIGINT data, the driver converts this to an SQL BIGINT value. Otherwise, the driver converts this to an SQL INTEGER value. SQL BIGINT data is supported on V4R5 and later.
Parameters:
parameterName - The parameter name.
parameterValue - The parameter value.
Throws:
java.sql.SQLException - If the statement is not open, the parameter name is not valid, or the parameter is not an input parameter.
Since:
Modification 5

setNull

public void setNull(java.lang.String parameterName,
                    int sqlType)
             throws java.sql.SQLException
Sets an input parameter to SQL NULL.
Parameters:
parameterName - The parameter name.
sqlType - The SQL type code defined in java.sql.Types.
Throws:
java.sql.SQLException - If the statement is not open, the parameterName is not valid, the parameter is not an input parameter, or the SQL type is not valid.
Since:
Modification 5

setNull

public void setNull(java.lang.String parameterName,
                    int sqlType,
                    java.lang.String typeName)
             throws java.sql.SQLException
Sets an input parameter to SQL NULL.
Parameters:
parameterName - The parameter name.
sqlType - The SQL type code defined in java.sql.Types.
typeName - The fully-qualified name of an SQL structured type. This value will be ignored.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the parameter is not an input parameter, or the SQL type is not valid.
Since:
Modification 5

setObject

public void setObject(java.lang.String parameterName,
                      java.lang.Object parameterValue)
               throws java.sql.SQLException
Sets an input parameter to an Object value. The driver converts this to a value of an SQL type, depending on the type of the specified value. The JDBC specification defines a standard mapping from Java types to SQL types. In the cases where a SQL type is not supported by DB2 UDB for iSeries, the next closest matching type is used.
If proxy support is in use, the Object must be serializable.
Parameters:
parameterName - The parameter name.
parameterValue - The parameter value or null to set the value to SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the parameter is not an input parameter, the type of value is not supported, or the parameter is not serializable (when proxy support is in use).
Since:
Modification 5

setObject

public void setObject(java.lang.String parameterName,
                      java.lang.Object parameterValue,
                      int targetSqlType)
               throws java.sql.SQLException
Sets an input parameter to an Object value. The driver converts this to a value with the specified SQL type.
If proxy support is in use, the Object must be serializable.
Parameters:
parameterName - The parameter name.
parameterValue - The parameter value or null to set the value to SQL NULL.
targetSQLType - The SQL type code defined in java.sql.Types.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the parameter is not an input parameter, the SQL type is not valid, the scale is not valid, or the parameter is not serializable (when proxy support is in use).
Since:
Modification 5

setObject

public void setObject(java.lang.String parameterName,
                      java.lang.Object parameterValue,
                      int targetSqlType,
                      int scale)
               throws java.sql.SQLException
Sets an input parameter to an Object value. The driver converts this to a value with the specified SQL type.
If proxy support is in use, the Object must be serializable.
Parameters:
parameterName - The parameter name.
parameterValue - The parameter value or null to set the value to SQL NULL.
targetSQLType - The SQL type code defined in java.sql.Types.
scale - The number of digits after the decimal if sqlType is DECIMAL or NUMERIC.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the parameter is not an input parameter, the SQL type is not valid, the scale is not valid, or the parameter is not serializable (when proxy support is in use).
Since:
Modification 5

setShort

public void setShort(java.lang.String parameterName,
                     short parameterValue)
              throws java.sql.SQLException
Sets an input parameter to a Java short value. The driver converts this to an SQL SMALLINT value.
Parameters:
parameterName - The parameter name.
parameterValue - The parameter value.
Throws:
java.sql.SQLException - If the statement is not open, the parameter name is not valid or the parameter is not an input parameter.
Since:
Modification 5

setString

public void setString(java.lang.String parameterName,
                      java.lang.String parameterValue)
               throws java.sql.SQLException
Sets an input parameter to a String value. The driver converts this to an SQL VARCHAR value.
Parameters:
parameterName - The parameter name.
parameterValue - The parameter value or null to set the value to SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the parameter name is not valid, or the parameter is not an input parameter.
Since:
Modification 5

setTime

public void setTime(java.lang.String parameterName,
                    java.sql.Time parameterValue)
             throws java.sql.SQLException
Sets an input parameter to a java.sql.Time value using the default calendar. The driver converts this to an SQL TIME value.
Parameters:
parameterName - The parameter name.
parameterValue - The parameter value or null to set the value to SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the parameter name is not valid, or the parameter is not an input parameter.
Since:
Modification 5

setTime

public void setTime(java.lang.String parameterName,
                    java.sql.Time parameterValue,
                    java.util.Calendar cal)
             throws java.sql.SQLException
Sets an input parameter to a java.sql.Time value using a calendar other than the default. The driver converts this to an SQL TIME value.
Parameters:
parameterIndex - The parameter index (1-based).
parameterValue - The parameter value or null to set the value to SQL NULL.
calendar - The calendar.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the parameter is not an input parameter, or the calendar is null.
Since:
Modification 5

setTimestamp

public void setTimestamp(java.lang.String parameterName,
                         java.sql.Timestamp parameterValue)
                  throws java.sql.SQLException
Sets an input parameter to a java.sql.Timestamp value using the default calendar. The driver converts this to an SQL TIMESTAMP value.
Parameters:
parameterName - The parameter name.
parameterValue - The parameter value or null to set the value to SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the parameter name is not valid, or the parameter is not an input parameter.
Since:
Modification 5

setTimestamp

public void setTimestamp(java.lang.String parameterName,
                         java.sql.Timestamp parameterValue,
                         java.util.Calendar cal)
                  throws java.sql.SQLException
Sets an input parameter to a java.sql.Timestamp value using a calendar other than the default. The driver converts this to an SQL TIMESTAMP value.
Parameters:
parameterIndex - The parameter index (1-based).
parameterValue - The parameter value or null to set the value to SQL NULL.
calendar - The calendar.
Throws:
java.sql.SQLException - If the statement is not open, the index is not valid, the parameter is not an input parameter, or the calendar is null.
Since:
Modification 5

setURL

public void setURL(java.lang.String parameterName,
                   java.net.URL parameterValue)
            throws java.sql.SQLException
Sets an input parameter to a URL value. The driver converts this to an SQL DATALINK value.
Parameters:
parameterName - The parameter name.
parameterValue - The parameter value or null to set the value to SQL NULL.
Throws:
java.sql.SQLException - If the statement is not open, the parameter name is not valid, or the parameter is not an input parameter.
Since:
Modification 5

wasNull

public boolean wasNull()
                throws java.sql.SQLException
Indicates if the last parameter read has the value of SQL NULL.
Specified by:
wasNull in interface java.sql.CallableStatement
Returns:
true if the value is SQL NULL; false otherwise.
Throws:
java.sql.SQLException - If the statement is not open.