com.ibm.as400.access

Class AS400JDBCCallableStatement

  • All Implemented Interfaces:
    CallableStatement, PreparedStatement, Statement, Wrapper


    public class AS400JDBCCallableStatement
    extends AS400JDBCPreparedStatement
    implements 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 Detail

      • getArray

        public Array getArray(String parameterName)
                       throws SQLException
        Returns the value of an SQL ARRAY output parameter as an Array value. DB2 for IBM i does not support arrays.
        Specified by:
        getArray in interface CallableStatement
        Parameters:
        parameterName - The parameter name.
        Returns:
        The parameter value or 0 if the value is SQL NULL.
        Throws:
        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 BigDecimal getBigDecimal(int parameterIndex)
                                 throws SQLException
        Returns the value of an SQL NUMERIC or DECIMAL output parameter as a BigDecimal object.
        Specified by:
        getBigDecimal in interface CallableStatement
        Parameters:
        parameterIndex - The parameter index (1-based).
        Returns:
        The parameter value or null if the value is SQL NULL.
        Throws:
        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 BigDecimal getBigDecimal(int parameterIndex,
                               int scale)
                                 throws 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 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:
        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 BigDecimal getBigDecimal(String parameterName)
                                 throws SQLException
        Returns the value of an SQL NUMERIC or DECIMAL output parameter as a BigDecimal object.
        Specified by:
        getBigDecimal in interface CallableStatement
        Parameters:
        parameterName - The parameter name.
        Returns:
        The parameter value or null if the value is SQL NULL.
        Throws:
        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.
      • getBlob

        public Blob getBlob(int parameterIndex)
                     throws SQLException
        Returns the value of an SQL BLOB output parameter as a Blob value.
        Specified by:
        getBlob in interface CallableStatement
        Parameters:
        parameterIndex - The parameter index (1-based).
        Returns:
        The parameter value or 0 if the value is SQL NULL.
        Throws:
        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 Blob getBlob(String parameterName)
                     throws SQLException
        Returns the value of an SQL BLOB output parameter as a Blob value.
        Specified by:
        getBlob in interface CallableStatement
        Parameters:
        parameterName - The parameter name.
        Returns:
        The parameter value or 0 if the value is SQL NULL.
        Throws:
        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.
      • getBoolean

        public boolean getBoolean(int parameterIndex)
                           throws SQLException
        Returns the value of an SQL SMALLINT output parameter as a Java boolean.
        Specified by:
        getBoolean in interface CallableStatement
        Parameters:
        parameterIndex - The parameter index (1-based).
        Returns:
        The parameter value or false if the value is SQL NULL.
        Throws:
        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(String parameterName)
                           throws SQLException
        Returns the value of an SQL SMALLINT output parameter as a Java boolean.
        Specified by:
        getBoolean in interface CallableStatement
        Parameters:
        parameterName - The parameter name.
        Returns:
        The parameter value or false if the value is SQL NULL.
        Throws:
        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.
      • getByte

        public byte getByte(int parameterIndex)
                     throws SQLException
        Returns the value of an SQL SMALLINT output parameter as a Java byte.
        Specified by:
        getByte in interface CallableStatement
        Parameters:
        parameterIndex - The parameter index (1-based).
        Returns:
        The parameter value or 0 if the value is SQL NULL.
        Throws:
        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(String parameterName)
                     throws SQLException
        Returns the value of an SQL SMALLINT output parameter as a Java byte.
        Specified by:
        getByte in interface CallableStatement
        Parameters:
        parameterName - The parameter name.
        Returns:
        The parameter value or 0 if the value is SQL NULL.
        Throws:
        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.
      • getBytes

        public byte[] getBytes(int parameterIndex)
                        throws SQLException
        Returns the value of an SQL BINARY or VARBINARY output parameter as a Java byte array.
        Specified by:
        getBytes in interface CallableStatement
        Parameters:
        parameterIndex - The parameter index (1-based).
        Returns:
        The parameter value or null if the value is SQL NULL.
        Throws:
        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(String parameterName)
                        throws SQLException
        Returns the value of an SQL BINARY or VARBINARY output parameter as a Java byte array.
        Specified by:
        getBytes in interface CallableStatement
        Parameters:
        parameterName - The parameter name.
        Returns:
        The parameter value or null if the value is SQL NULL.
        Throws:
        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 Clob getClob(int parameterIndex)
                     throws SQLException
        Returns the value of an SQL CLOB output parameter as a Clob value.
        Specified by:
        getClob in interface CallableStatement
        Parameters:
        parameterIndex - The parameter index (1-based).
        Returns:
        The parameter value or 0 if the value is SQL NULL.
        Throws:
        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 Clob getClob(String parameterName)
                     throws SQLException
        Returns the value of an SQL CLOB output parameter as a Clob value.
        Specified by:
        getClob in interface CallableStatement
        Parameters:
        parameterName - The parameter name.
        Returns:
        The parameter value or 0 if the value is SQL NULL.
        Throws:
        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 Date getDate(int parameterIndex)
                     throws 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 CallableStatement
        Parameters:
        parameterIndex - The parameter index (1-based).
        Returns:
        The parameter value or null if the value is SQL NULL.
        Throws:
        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 Date getDate(int parameterIndex,
                   Calendar calendar)
                     throws 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 CallableStatement
        Parameters:
        parameterIndex - The parameter index (1-based).
        calendar - The calendar.
        Returns:
        The parameter value or null if the value is SQL NULL.
        Throws:
        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 Date getDate(String parameterName)
                     throws 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 CallableStatement
        Parameters:
        parameterName - The parameter name.
        Returns:
        The parameter value or null if the value is SQL NULL.
        Throws:
        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.
      • getDate

        public Date getDate(String parameterName,
                   Calendar calendar)
                     throws 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 CallableStatement
        Parameters:
        parameterName - The parameter name.
        calendar - The calendar.
        Returns:
        The parameter value or null if the value is SQL NULL.
        Throws:
        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 SQLException
        Returns the value of an SQL DOUBLE or FLOAT output parameter as a Java double.
        Specified by:
        getDouble in interface CallableStatement
        Parameters:
        parameterIndex - The parameter index (1-based).
        Returns:
        The parameter value or 0 if the value is SQL NULL.
        Throws:
        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(String parameterName)
                         throws SQLException
        Returns the value of an SQL DOUBLE or FLOAT output parameter as a Java double.
        Specified by:
        getDouble in interface CallableStatement
        Parameters:
        parameterName - The parameter name.
        Returns:
        The parameter value or 0 if the value is SQL NULL.
        Throws:
        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(int parameterIndex)
                       throws SQLException
        Returns the value of an SQL REAL or FLOAT output parameter as a Java float.
        Specified by:
        getFloat in interface CallableStatement
        Parameters:
        parameterIndex - The parameter index (1-based).
        Returns:
        The parameter value or 0 if the value is SQL NULL.
        Throws:
        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(String parameterName)
                       throws SQLException
        Returns the value of an SQL REAL or FLOAT output parameter as a Java float.
        Specified by:
        getFloat in interface CallableStatement
        Parameters:
        parameterName - The parameter name.
        Returns:
        The parameter value or 0 if the value is SQL NULL.
        Throws:
        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(int parameterIndex)
                   throws SQLException
        Returns the value of an SQL INTEGER output parameter as a Java int.
        Specified by:
        getInt in interface CallableStatement
        Parameters:
        parameterIndex - The parameter index (1-based).
        Returns:
        The parameter value or 0 if the value is SQL NULL.
        Throws:
        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(String parameterName)
                   throws SQLException
        Returns the value of an SQL INTEGER output parameter as a Java int.
        Specified by:
        getInt in interface CallableStatement
        Parameters:
        parameterName - The parameter name.
        Returns:
        The parameter value or 0 if the value is SQL NULL.
        Throws:
        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(int parameterIndex)
                     throws SQLException
        If the connected system 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 CallableStatement
        Parameters:
        parameterIndex - The parameter index (1-based).
        Returns:
        The parameter value or 0 if the value is SQL NULL.
        Throws:
        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(String parameterName)
                     throws SQLException
        If the connected system 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 CallableStatement
        Parameters:
        parameterName - The parameter name.
        Returns:
        The parameter value or 0 if the value is SQL NULL.
        Throws:
        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 Object getObject(int parameterIndex)
                         throws 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 CallableStatement
        Parameters:
        parameterIndex - The parameter index (1-based).
        Returns:
        The parameter value or null if the value is SQL NULL.
        Throws:
        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 Object getObject(int parameterIndex,
                       Map typeMap)
                         throws 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 CallableStatement
        Parameters:
        parameterIndex - The parameter index (1-based).
        typeMap - The type map. This is not used.
        Returns:
        The parameter value or null if the value is SQL NULL.
        Throws:
        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 Object getObject(String parameterName)
                         throws 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 CallableStatement
        Parameters:
        parameterName - The parameter name.
        Returns:
        The parameter value or null if the value is SQL NULL.
        Throws:
        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.
      • getObject

        public Object getObject(String parameterName,
                       Map typeMap)
                         throws 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 CallableStatement
        Parameters:
        parameterName - The parameter name.
        typeMap - The type map. This is not used.
        Returns:
        The parameter value or null if the value is SQL NULL.
        Throws:
        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.
      • getRef

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

        public Ref getRef(String parameterName)
                   throws SQLException
        Returns the value of an SQL REF output parameter as a Ref value. DB2 for IBM i does not support structured types.
        Specified by:
        getRef in interface CallableStatement
        Parameters:
        parameterName - The parameter name.
        Returns:
        The parameter value or 0 if the value is SQL NULL.
        Throws:
        SQLException - Always thrown because DB2 for IBM i does not support REFs.
      • getShort

        public short getShort(int parameterIndex)
                       throws SQLException
        Returns the value of an SQL SMALLINT output parameter as a Java short value.
        Specified by:
        getShort in interface CallableStatement
        Parameters:
        parameterIndex - The parameter index (1-based).
        Returns:
        The parameter value or 0 if the value is SQL NULL.
        Throws:
        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(String parameterName)
                       throws SQLException
        Returns the value of an SQL SMALLINT output parameter as a Java short value.
        Specified by:
        getShort in interface CallableStatement
        Parameters:
        parameterName - The parameter name.
        Returns:
        The parameter value or 0 if the value is SQL NULL.
        Throws:
        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 String getString(int parameterIndex)
                         throws SQLException
        Returns the value of an SQL CHAR or VARCHAR output parameter as a Java String object.
        Specified by:
        getString in interface CallableStatement
        Parameters:
        parameterIndex - The parameter index (1-based).
        Returns:
        The parameter value or null if the value is SQL NULL.
        Throws:
        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 String getString(String parameterName)
                         throws SQLException
        Returns the value of an SQL CHAR or VARCHAR output parameter as a Java String object.
        Specified by:
        getString in interface CallableStatement
        Parameters:
        parameterName - The parameter name.
        Returns:
        The parameter value or null if the value is SQL NULL.
        Throws:
        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 Time getTime(int parameterIndex)
                     throws 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 CallableStatement
        Parameters:
        parameterIndex - The parameter index (1-based).
        Returns:
        The parameter value or null if the value is SQL NULL.
        Throws:
        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 Time getTime(int parameterIndex,
                   Calendar calendar)
                     throws 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 CallableStatement
        Parameters:
        parameterIndex - The parameter index (1-based).
        calendar - The calendar.
        Returns:
        The parameter value or null if the value is SQL NULL.
        Throws:
        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 Time getTime(String parameterName)
                     throws 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 CallableStatement
        Parameters:
        parameterName - The parameter name.
        Returns:
        The parameter value or null if the value is SQL NULL.
        Throws:
        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.
      • getTime

        public Time getTime(String parameterName,
                   Calendar calendar)
                     throws 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 CallableStatement
        Parameters:
        parameterName - The parameter name.
        calendar - The calendar.
        Returns:
        The parameter value or null if the value is SQL NULL.
        Throws:
        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.
      • getTimestamp

        public Timestamp getTimestamp(int parameterIndex)
                               throws 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 CallableStatement
        Parameters:
        parameterIndex - The parameter index (1-based).
        Returns:
        The parameter value or null if the value is SQL NULL.
        Throws:
        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 Timestamp getTimestamp(int parameterIndex,
                             Calendar calendar)
                               throws 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 CallableStatement
        Parameters:
        parameterIndex - The parameter index (1-based).
        calendar - The calendar.
        Returns:
        The parameter value or null if the value is SQL NULL.
        Throws:
        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 Timestamp getTimestamp(String parameterName)
                               throws 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 CallableStatement
        Parameters:
        parameterName - The parameter name.
        Returns:
        The parameter value or null if the value is SQL NULL.
        Throws:
        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.
      • getTimestamp

        public Timestamp getTimestamp(String parameterName,
                             Calendar calendar)
                               throws 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 CallableStatement
        Parameters:
        parameterName - The parameter name.
        calendar - The calendar.
        Returns:
        The parameter value or null if the value is SQL NULL.
        Throws:
        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.
      • getURL

        public URL getURL(int parameterIndex)
                   throws SQLException
        Returns the value of an SQL DATALINK output parameter as a java.net.URL object.
        Specified by:
        getURL in interface CallableStatement
        Parameters:
        parameterIndex - The parameter index (1-based).
        Returns:
        The parameter value or null if the value is SQL NULL.
        Throws:
        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.
      • getURL

        public URL getURL(String parameterName)
                   throws SQLException
        Returns the value of an SQL DATALINK output parameter as a java.net.URL object.
        Specified by:
        getURL in interface CallableStatement
        Parameters:
        parameterName - The parameter name.
        Returns:
        The parameter value or null if the value is SQL NULL.
        Throws:
        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.
      • registerOutParameter

        public void registerOutParameter(int parameterIndex,
                                int sqlType,
                                int scale)
                                  throws 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 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:
        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 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 CallableStatement
        Parameters:
        parameterIndex - The parameter index (1-based).
        sqlType - The SQL type code defined in java.sql.Types.
        Throws:
        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,
                                String typeName)
                                  throws 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 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:
        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(String parameterName,
                                int sqlType)
                                  throws 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 CallableStatement
        Parameters:
        parameterName - The parameter name.
        sqlType - The SQL type code defined in java.sql.Types.
        Throws:
        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(String parameterName,
                                int sqlType,
                                int scale)
                                  throws 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 CallableStatement
        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:
        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(String parameterName,
                                int sqlType,
                                String typeName)
                                  throws 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 CallableStatement
        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:
        SQLException - If the index is not valid, the parameter is not an output parameter, or the requested conversion is not valid.
      • setAsciiStream

        public void setAsciiStream(String parameterName,
                          InputStream parameterValue,
                          int length)
                            throws 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.
        Specified by:
        setAsciiStream in interface CallableStatement
        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:
        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.
      • setBigDecimal

        public void setBigDecimal(String parameterName,
                         BigDecimal parameterValue)
                           throws SQLException
        Sets an input parameter to a BigDecimal value. The driver converts this to an SQL NUMERIC value.
        Specified by:
        setBigDecimal in interface CallableStatement
        Parameters:
        parameterName - The parameter name.
        parameterValue - The parameter value or null to set the value to SQL NULL.
        Throws:
        SQLException - If the statement is not open, the index is not valid, or the parameter is not an input parameter.
      • setBinaryStream

        public void setBinaryStream(String parameterName,
                           InputStream parameterValue,
                           int length)
                             throws 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.
        Specified by:
        setBinaryStream in interface CallableStatement
        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:
        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.
      • setBoolean

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

        public void setByte(String parameterName,
                   byte parameterValue)
                     throws SQLException
        Sets an input parameter to a Java byte value. The driver converts this to an SQL SMALLINT value.
        Specified by:
        setByte in interface CallableStatement
        Parameters:
        parameterName - The parameter name.
        parameterValue - The parameter value.
        Throws:
        SQLException - If the statement is not open, the parameter name is not valid, or the parameter is not an input parameter.
      • setBytes

        public void setBytes(String parameterName,
                    byte[] parameterValue)
                      throws SQLException
        Sets an input parameter to a Java byte array value. The driver converts this to an SQL VARBINARY value.
        Specified by:
        setBytes in interface CallableStatement
        Parameters:
        parameterName - The parameter name.
        parameterValue - The parameter value or null to set the value to SQL NULL.
        Throws:
        SQLException - If the statement is not open, the parameter name is not valid, or the parameter is not an input parameter.
      • setCharacterStream

        public void setCharacterStream(String parameterName,
                              Reader parameterValue,
                              int length)
                                throws 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.
        Specified by:
        setCharacterStream in interface CallableStatement
        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:
        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
      • setDate

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

        public void setDate(String parameterName,
                   Date parameterValue,
                   Calendar cal)
                     throws 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.
        Specified by:
        setDate in interface CallableStatement
        Parameters:
        parameterName - The parameter name.
        parameterValue - The parameter value or null to set the value to SQL NULL.
        cal - The calendar.
        Throws:
        SQLException - If the statement is not open, the index is not valid, the parameter is not an input parameter, or the calendar is null.
      • setDouble

        public void setDouble(String parameterName,
                     double parameterValue)
                       throws SQLException
        Sets an input parameter to a Java double value. The driver converts this to an SQL DOUBLE value.
        Specified by:
        setDouble in interface CallableStatement
        Parameters:
        parameterName - The parameter name.
        parameterValue - The parameter value.
        Throws:
        SQLException - If the statement is not open, the parameter name is not valid or the parameter is not an input parameter.
      • setFloat

        public void setFloat(String parameterName,
                    float parameterValue)
                      throws SQLException
        Sets an input parameter to a Java float value. The driver converts this to an SQL REAL value.
        Specified by:
        setFloat in interface CallableStatement
        Parameters:
        parameterName - The parameter name.
        parameterValue - The parameter value.
        Throws:
        SQLException - If the statement is not open, the parameter name is not valid, or the parameter is not an input parameter.
      • setInt

        public void setInt(String parameterName,
                  int parameterValue)
                    throws SQLException
        Sets an input parameter to a Java int value. The driver converts this to an SQL INTEGER value.
        Specified by:
        setInt in interface CallableStatement
        Parameters:
        parameterName - The parameter name.
        parameterValue - The parameter value.
        Throws:
        SQLException - If the statement is not open, the parameter name is not valid or the parameter is not an input parameter.
      • setLong

        public void setLong(String parameterName,
                   long parameterValue)
                     throws SQLException
        Sets an input parameter to a Java long value. If the connected system 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.
        Specified by:
        setLong in interface CallableStatement
        Parameters:
        parameterName - The parameter name.
        parameterValue - The parameter value.
        Throws:
        SQLException - If the statement is not open, the parameter name is not valid, or the parameter is not an input parameter.
      • setNull

        public void setNull(String parameterName,
                   int sqlType)
                     throws SQLException
        Sets an input parameter to SQL NULL.
        Specified by:
        setNull in interface CallableStatement
        Parameters:
        parameterName - The parameter name.
        sqlType - The SQL type code defined in java.sql.Types.
        Throws:
        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.
      • setNull

        public void setNull(String parameterName,
                   int sqlType,
                   String typeName)
                     throws SQLException
        Sets an input parameter to SQL NULL.
        Specified by:
        setNull in interface CallableStatement
        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:
        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.
      • setObject

        public void setObject(String parameterName,
                     Object parameterValue)
                       throws 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 for IBM i, the next closest matching type is used.
        If proxy support is in use, the Object must be serializable.
        Specified by:
        setObject in interface CallableStatement
        Parameters:
        parameterName - The parameter name.
        parameterValue - The parameter value or null to set the value to SQL NULL.
        Throws:
        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).
      • setObject

        public void setObject(String parameterName,
                     Object parameterValue,
                     int targetSqlType)
                       throws 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.
        Specified by:
        setObject in interface CallableStatement
        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:
        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).
      • setObject

        public void setObject(String parameterName,
                     Object parameterValue,
                     int targetSqlType,
                     int scale)
                       throws 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.
        Specified by:
        setObject in interface CallableStatement
        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:
        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).
      • setShort

        public void setShort(String parameterName,
                    short parameterValue)
                      throws SQLException
        Sets an input parameter to a Java short value. The driver converts this to an SQL SMALLINT value.
        Specified by:
        setShort in interface CallableStatement
        Parameters:
        parameterName - The parameter name.
        parameterValue - The parameter value.
        Throws:
        SQLException - If the statement is not open, the parameter name is not valid or the parameter is not an input parameter.
      • setString

        public void setString(String parameterName,
                     String parameterValue)
                       throws SQLException
        Sets an input parameter to a String value. The driver converts this to an SQL VARCHAR value.
        Specified by:
        setString in interface CallableStatement
        Parameters:
        parameterName - The parameter name.
        parameterValue - The parameter value or null to set the value to SQL NULL.
        Throws:
        SQLException - If the statement is not open, the parameter name is not valid, or the parameter is not an input parameter.
      • setTime

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

        public void setTime(String parameterName,
                   Time parameterValue,
                   Calendar cal)
                     throws 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.
        Specified by:
        setTime in interface CallableStatement
        Parameters:
        parameterName - The parameter name.
        parameterValue - The parameter value or null to set the value to SQL NULL.
        cal - The calendar.
        Throws:
        SQLException - If the statement is not open, the index is not valid, the parameter is not an input parameter, or the calendar is null.
      • setTimestamp

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

        public void setTimestamp(String parameterName,
                        Timestamp parameterValue,
                        Calendar cal)
                          throws 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.
        Specified by:
        setTimestamp in interface CallableStatement
        Parameters:
        parameterName - The parameter name.
        parameterValue - The parameter value or null to set the value to SQL NULL.
        cal - The calendar.
        Throws:
        SQLException - If the statement is not open, the index is not valid, the parameter is not an input parameter, or the calendar is null.
      • setURL

        public void setURL(String parameterName,
                  URL parameterValue)
                    throws SQLException
        Sets an input parameter to a URL value. The driver converts this to an SQL DATALINK value.
        Specified by:
        setURL in interface CallableStatement
        Parameters:
        parameterName - The parameter name.
        parameterValue - The parameter value or null to set the value to SQL NULL.
        Throws:
        SQLException - If the statement is not open, the parameter name is not valid, or the parameter is not an input parameter.
      • wasNull

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

        public Reader getCharacterStream(int parameterIndex)
                                  throws SQLException
        Retrieves the value of the designated parameter as a java.io.Reader object in the Java programming language.
        Specified by:
        getCharacterStream in interface CallableStatement
        Parameters:
        parameterIndex - the first parameter is 1, the second is 2, ...
        Returns:
        a java.io.Reader object that contains the parameter value; if the value is SQL NULL, the value returned is null in the Java programming language.
        Throws:
        SQLException - if a database access error occurs or this method is called on a closed CallableStatement
      • getCharacterStream

        public Reader getCharacterStream(String parameterName)
                                  throws SQLException
        Retrieves the value of the designated parameter as a java.io.Reader object in the Java programming language.
        Specified by:
        getCharacterStream in interface CallableStatement
        Parameters:
        parameterName - the name of the parameter
        Returns:
        a java.io.Reader object that contains the parameter value; if the value is SQL NULL, the value returned is null in the Java programming language
        Throws:
        SQLException - if a database access error occurs or this method is called on a closed CallableStatement
        SQLFeatureNotSupportedException - if the JDBC driver does not support this method
      • getNCharacterStream

        public Reader getNCharacterStream(int parameterIndex)
                                   throws SQLException
        Retrieves the value of the designated parameter as a java.io.Reader object in the Java programming language. It is intended for use when accessing NCHAR,NVARCHAR and LONGNVARCHAR parameters.
        Specified by:
        getNCharacterStream in interface CallableStatement
        Parameters:
        parameterIndex - the first parameter is 1, the second is 2, ...
        Returns:
        a java.io.Reader object that contains the parameter value; if the value is SQL NULL, the value returned is null in the Java programming language.
        Throws:
        SQLException - if a database access error occurs or this method is called on a closed CallableStatement
        SQLFeatureNotSupportedException - if the JDBC driver does not support this method
      • getNCharacterStream

        public Reader getNCharacterStream(String parameterName)
                                   throws SQLException
        Retrieves the value of the designated parameter as a java.io.Reader object in the Java programming language. It is intended for use when accessing NCHAR,NVARCHAR and LONGNVARCHAR parameters.
        Specified by:
        getNCharacterStream in interface CallableStatement
        Parameters:
        parameterName - the name of the parameter
        Returns:
        a java.io.Reader object that contains the parameter value; if the value is SQL NULL, the value returned is null in the Java programming language
        Throws:
        SQLException - if a database access error occurs or this method is called on a closed CallableStatement
        SQLFeatureNotSupportedException - if the JDBC driver does not support this method
      • getNString

        public String getNString(int parameterIndex)
                          throws SQLException
        Retrieves the value of the designated NCHAR, NVARCHAR or LONGNVARCHAR parameter as a String in the Java programming language.

        For the fixed-length type JDBC NCHAR, the String object returned has exactly the same value the SQL NCHAR value had in the database, including any padding added by the database.

        Specified by:
        getNString in interface CallableStatement
        Parameters:
        parameterIndex - index of the first parameter is 1, the second is 2, ...
        Returns:
        a String object that maps an NCHAR, NVARCHAR or LONGNVARCHAR value
        Throws:
        SQLException - if a database access error occurs or this method is called on a closed CallableStatement
        SQLFeatureNotSupportedException - if the JDBC driver does not support this method
        See Also:
        setNString(java.lang.String, java.lang.String)
      • getNString

        public String getNString(String parameterName)
                          throws SQLException
        Retrieves the value of the designated NCHAR, NVARCHAR or LONGNVARCHAR parameter as a String in the Java programming language.

        For the fixed-length type JDBC NCHAR, the String object returned has exactly the same value the SQL NCHAR value had in the database, including any padding added by the database.

        Specified by:
        getNString in interface CallableStatement
        Parameters:
        parameterName - the name of the parameter
        Returns:
        a String object that maps an NCHAR, NVARCHAR or LONGNVARCHAR value
        Throws:
        SQLException - if a database access error occurs or this method is called on a closed CallableStatement
        SQLFeatureNotSupportedException - if the JDBC driver does not support this method
        See Also:
        setNString(java.lang.String, java.lang.String)
      • setAsciiStream

        public void setAsciiStream(String parameterName,
                          InputStream x,
                          long length)
                            throws SQLException
        Sets the designated parameter to the given input stream, which will have the specified number of bytes. When a very large ASCII value is input to a LONGVARCHAR parameter, it may be more practical to send it via a java.io.InputStream. Data will be read from the stream as needed until end-of-file is reached. The JDBC driver will do any necessary conversion from ASCII to the database char format.

        Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.

        Specified by:
        setAsciiStream in interface CallableStatement
        Parameters:
        parameterName - the name of the parameter
        x - the Java input stream that contains the ASCII parameter value
        length - the number of bytes in the stream
        Throws:
        SQLException - if a database access error occurs or this method is called on a closed CallableStatement
        SQLFeatureNotSupportedException - if the JDBC driver does not support this method
      • setBinaryStream

        public void setBinaryStream(String parameterName,
                           InputStream x,
                           long length)
                             throws SQLException
        Sets the designated parameter to the given input stream, which will have the specified number of bytes. When a very large binary value is input to a LONGVARBINARY parameter, it may be more practical to send it via a java.io.InputStream object. The data will be read from the stream as needed until end-of-file is reached.

        Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.

        Specified by:
        setBinaryStream in interface CallableStatement
        Parameters:
        parameterName - the name of the parameter
        x - the java input stream which contains the binary parameter value
        length - the number of bytes in the stream
        Throws:
        SQLException - if a database access error occurs or this method is called on a closed CallableStatement
        SQLFeatureNotSupportedException - if the JDBC driver does not support this method.
      • setBlob

        public void setBlob(String parameterName,
                   Blob x)
                     throws SQLException
        Sets the designated parameter to the given java.sql.Blob object. The driver converts this to an SQL BLOB value when it sends it to the database.
        Specified by:
        setBlob in interface CallableStatement
        Parameters:
        parameterName - the name of the parameter
        x - a Blob object that maps an SQL BLOB value
        Throws:
        SQLException - if a database access error occurs or this method is called on a closed CallableStatement
        SQLFeatureNotSupportedException - if the JDBC driver does not support this method
      • setBlob

        public void setBlob(String parameterName,
                   InputStream inputStream,
                   long length)
                     throws SQLException
        Sets the designated parameter to a InputStream object. The InputStream must contain the number of characters specified by length, otherwise a SQLException will be generated when the CallableStatement is executed. This method differs from the setBinaryStream (int, InputStream, int) method because it informs the driver that the parameter value should be sent to the system as a BLOB. When the setBinaryStream method is used, the driver may have to do extra work to determine whether the parameter data should be sent to the system as a LONGVARBINARY or a BLOB
        Specified by:
        setBlob in interface CallableStatement
        Parameters:
        parameterName - the name of the parameter to be set
        inputStream - An object that contains the data to set the parameter value to.
        length - the number of bytes in the parameter data.
        Throws:
        SQLException - if parameterIndex does not correspond to a parameter marker in the SQL statement, or if the length specified is less than zero; if the number of bytes in the inputStream does not match the specfied length; if a database access error occurs or this method is called on a closed CallableStatement
        SQLFeatureNotSupportedException - if the JDBC driver does not support this method
      • setCharacterStream

        public void setCharacterStream(String parameterName,
                              Reader reader,
                              long length)
                                throws SQLException
        Sets the designated parameter to the given Reader object, which is the given number of characters long. When a very large UNICODE value is input to a LONGVARCHAR parameter, it may be more practical to send it via a java.io.Reader object. The data will be read from the stream as needed until end-of-file is reached. The JDBC driver will do any necessary conversion from UNICODE to the database char format.

        Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.

        Specified by:
        setCharacterStream in interface CallableStatement
        Parameters:
        parameterName - the name of the parameter
        reader - the java.io.Reader object that contains the UNICODE data used as the designated parameter
        length - the number of characters in the stream
        Throws:
        SQLException - if a database access error occurs or this method is called on a closed CallableStatement
        SQLFeatureNotSupportedException - if the JDBC driver does not support this method
      • setClob

        public void setClob(String parameterName,
                   Clob x)
                     throws SQLException
        Sets the designated parameter to the given java.sql.Clob object. The driver converts this to an SQL CLOB value when it sends it to the database.
        Specified by:
        setClob in interface CallableStatement
        Parameters:
        parameterName - the name of the parameter
        x - a Clob object that maps an SQL CLOB value
        Throws:
        SQLException - if a database access error occurs or this method is called on a closed CallableStatement
        SQLFeatureNotSupportedException - if the JDBC driver does not support this method
      • setClob

        public void setClob(String parameterName,
                   Reader reader,
                   long length)
                     throws SQLException
        Sets the designated parameter to a Reader object. The reader must contain the number of characters specified by length otherwise a SQLException will be generated when the CallableStatement is executed. This method differs from the setCharacterStream (int, Reader, int) method because it informs the driver that the parameter value should be sent to the system as a CLOB. When the setCharacterStream method is used, the driver may have to do extra work to determine whether the parameter data should be sent to the system as a LONGVARCHAR or a CLOB
        Specified by:
        setClob in interface CallableStatement
        Parameters:
        parameterName - the name of the parameter to be set
        reader - An object that contains the data to set the parameter value to.
        length - the number of characters in the parameter data.
        Throws:
        SQLException - if parameterIndex does not correspond to a parameter marker in the SQL statement; if the length specified is less than zero; a database access error occurs or this method is called on a closed CallableStatement
        SQLFeatureNotSupportedException - if the JDBC driver does not support this method
      • setNCharacterStream

        public void setNCharacterStream(String parameterName,
                               Reader value,
                               long length)
                                 throws SQLException
        Sets the designated parameter to a Reader object. The Reader reads the data till end-of-file is reached. The driver does the necessary conversion from Java character format to the national character set in the database.
        Specified by:
        setNCharacterStream in interface CallableStatement
        Parameters:
        parameterName - the name of the parameter to be set
        value - the parameter value
        length - the number of characters in the parameter data.
        Throws:
        SQLException - if the driver does not support national character sets; if the driver can detect that a data conversion error could occur; if a database access error occurs or this method is called on a closed CallableStatement
        SQLFeatureNotSupportedException - if the JDBC driver does not support this method
      • setNClob

        public void setNClob(String parameterName,
                    Reader reader,
                    long length)
                      throws SQLException
        Sets the designated parameter to a Reader object. The reader must contain the number of characters specified by length otherwise a SQLException will be generated when the CallableStatement is executed. This method differs from the setCharacterStream (int, Reader, int) method because it informs the driver that the parameter value should be sent to the system as a NCLOB. When the setCharacterStream method is used, the driver may have to do extra work to determine whether the parameter data should be sent to the system as a LONGNVARCHAR or a NCLOB
        Specified by:
        setNClob in interface CallableStatement
        Parameters:
        parameterName - the name of the parameter to be set
        reader - An object that contains the data to set the parameter value to.
        length - the number of characters in the parameter data.
        Throws:
        SQLException - if parameterIndex does not correspond to a parameter marker in the SQL statement; if the length specified is less than zero; if the driver does not support national character sets; if the driver can detect that a data conversion error could occur; if a database access error occurs or this method is called on a closed CallableStatement
        SQLFeatureNotSupportedException - if the JDBC driver does not support this method
      • setNString

        public void setNString(String parameterName,
                      String value)
                        throws SQLException
        Sets the designated parameter to the given String object. The driver converts this to a SQL NCHAR or NVARCHAR or LONGNVARCHAR
        Specified by:
        setNString in interface CallableStatement
        Parameters:
        parameterName - the name of the parameter to be set
        value - the parameter value
        Throws:
        SQLException - if the driver does not support national character sets; if the driver can detect that a data conversion error could occur; if a database access error occurs or this method is called on a closed CallableStatement
        SQLFeatureNotSupportedException - if the JDBC driver does not support this method
      • setAsciiStream

        public void setAsciiStream(String parameterName,
                          InputStream x)
                            throws SQLException
        Sets the designated parameter to the given input stream. When a very large ASCII value is input to a LONGVARCHAR parameter, it may be more practical to send it via a java.io.InputStream. Data will be read from the stream as needed until end-of-file is reached. The JDBC driver will do any necessary conversion from ASCII to the database char format.

        Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.

        Note: Consult your JDBC driver documentation to determine if it might be more efficient to use a version of setAsciiStream which takes a length parameter.

        Specified by:
        setAsciiStream in interface CallableStatement
        Parameters:
        parameterName - the name of the parameter
        x - the Java input stream that contains the ASCII parameter value
        Throws:
        SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed CallableStatement
        SQLFeatureNotSupportedException - if the JDBC driver does not support this method
      • setBinaryStream

        public void setBinaryStream(String parameterName,
                           InputStream x)
                             throws SQLException
        Sets the designated parameter to the given input stream. When a very large binary value is input to a LONGVARBINARY parameter, it may be more practical to send it via a java.io.InputStream object. The data will be read from the stream as needed until end-of-file is reached.

        Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.

        Note: Consult your JDBC driver documentation to determine if it might be more efficient to use a version of setBinaryStream which takes a length parameter.

        Specified by:
        setBinaryStream in interface CallableStatement
        Parameters:
        parameterName - the name of the parameter
        x - the java input stream which contains the binary parameter value
        Throws:
        SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed CallableStatement
        SQLFeatureNotSupportedException - if the JDBC driver does not support this method
      • setBlob

        public void setBlob(String parameterName,
                   InputStream inputStream)
                     throws SQLException
        Sets the designated parameter to a InputStream object. This method differs from the setBinaryStream (int, InputStream) method because it informs the driver that the parameter value should be sent to the system as a BLOB. When the setBinaryStream method is used, the driver may have to do extra work to determine whether the parameter data should be sent to the system as a LONGVARBINARY or a BLOB

        Note: Consult your JDBC driver documentation to determine if it might be more efficient to use a version of setBlob which takes a length parameter.

        Specified by:
        setBlob in interface CallableStatement
        Parameters:
        parameterName - the name of the parameter
        inputStream - An object that contains the data to set the parameter value to.
        Throws:
        SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed CallableStatement
        SQLFeatureNotSupportedException - if the JDBC driver does not support this method
      • setCharacterStream

        public void setCharacterStream(String parameterName,
                              Reader reader)
                                throws SQLException
        Sets the designated parameter to the given Reader object. When a very large UNICODE value is input to a LONGVARCHAR parameter, it may be more practical to send it via a java.io.Reader object. The data will be read from the stream as needed until end-of-file is reached. The JDBC driver will do any necessary conversion from UNICODE to the database char format.

        Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.

        Note: Consult your JDBC driver documentation to determine if it might be more efficient to use a version of setCharacterStream which takes a length parameter.

        Specified by:
        setCharacterStream in interface CallableStatement
        Parameters:
        parameterName - the name of the parameter
        reader - the java.io.Reader object that contains the Unicode data
        Throws:
        SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed CallableStatement
        SQLFeatureNotSupportedException - if the JDBC driver does not support this method
      • setClob

        public void setClob(String parameterName,
                   Reader reader)
                     throws SQLException
        Sets the designated parameter to a Reader object. This method differs from the setCharacterStream (int, Reader) method because it informs the driver that the parameter value should be sent to the system as a CLOB. When the setCharacterStream method is used, the driver may have to do extra work to determine whether the parameter data should be sent to the system as a LONGVARCHAR or a CLOB

        Note: Consult your JDBC driver documentation to determine if it might be more efficient to use a version of setClob which takes a length parameter.

        Specified by:
        setClob in interface CallableStatement
        Parameters:
        parameterName - the name of the parameter
        reader - An object that contains the data to set the parameter value to.
        Throws:
        SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed CallableStatement
        SQLFeatureNotSupportedException - if the JDBC driver does not support this method
      • setNCharacterStream

        public void setNCharacterStream(String parameterName,
                               Reader value)
                                 throws SQLException
        Sets the designated parameter to a Reader object. The Reader reads the data till end-of-file is reached. The driver does the necessary conversion from Java character format to the national character set in the database.

        Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.

        Note: Consult your JDBC driver documentation to determine if it might be more efficient to use a version of setNCharacterStream which takes a length parameter.

        Specified by:
        setNCharacterStream in interface CallableStatement
        Parameters:
        parameterName - the name of the parameter
        value - the parameter value
        Throws:
        SQLException - if parameterName does not correspond to a named parameter; if the driver does not support national character sets; if the driver can detect that a data conversion error could occur; if a database access error occurs; or this method is called on a closed CallableStatement
        SQLFeatureNotSupportedException - if the JDBC driver does not support this method
      • setNClob

        public void setNClob(String parameterName,
                    Reader reader)
                      throws SQLException
        Sets the designated parameter to a Reader object. This method differs from the setCharacterStream (int, Reader) method because it informs the driver that the parameter value should be sent to the system as a NCLOB. When the setCharacterStream method is used, the driver may have to do extra work to determine whether the parameter data should be sent to the system as a LONGNVARCHAR or a NCLOB

        Note: Consult your JDBC driver documentation to determine if it might be more efficient to use a version of setNClob which takes a length parameter.

        Specified by:
        setNClob in interface CallableStatement
        Parameters:
        parameterName - the name of the parameter
        reader - An object that contains the data to set the parameter value to.
        Throws:
        SQLException - if parameterName does not correspond to a named parameter; if the driver does not support national character sets; if the driver can detect that a data conversion error could occur; if a database access error occurs or this method is called on a closed CallableStatement
        SQLFeatureNotSupportedException - if the JDBC driver does not support this method
      • setObject

        public void setObject(String parameterName,
                     Object x,
                     Object targetSqlType,
                     int scaleOrLength)
                       throws SQLException
        Sets the value of the designated parameter with the given object. If the second argument is an InputStream then the stream must contain the number of bytes specified by scaleOrLength. If the second argument is a Reader then the reader must contain the number of characters specified by scaleOrLength. If these conditions are not true the driver will generate a SQLException when the prepared statement is executed.

        The given Java object will be converted to the given targetSqlType before being sent to the database. If the object has a custom mapping (is of a class implementing the interface SQLData), the JDBC driver should call the method SQLData.writeSQL to write it to the SQL data stream. If, on the other hand, the object is of a class implementing Ref, Blob, Clob, NClob, Struct, java.net.URL, or Array, the driver should pass it to the database as a value of the corresponding SQL type.

        Note that this method may be used to pass database-specific abstract data types.

        Parameters:
        parameterName - - the name of the parameter
        x - - the object containing the input parameter value
        targetSqlType - - the SQL type to be sent to the database. The scale argument may further qualify this type.
        scaleOrLength - - for java.sql.JDBCType.DECIMAL or java.sql.JDBCType.NUMERIC types, this is the number of digits after the decimal point. For Java Object types InputStream and Reader, this is the length of the data in the stream or reader. For all other types, this value will be ignored.
        Throws:
        SQLException - - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed CallableStatement or if the Java Object specified by x is an InputStream or Reader object and the value of the scale parameter is less than zero
        SQLFeatureNotSupportedException - - if the JDBC driver does not support this data type
      • setObject

        public void setObject(String parameterName,
                     Object x,
                     Object targetSqlType)
                       throws SQLException
        Sets the value of the designated parameter with the given object. This method is similar to setObject(String parameterName, Object x, SQLType targetSqlType, int scaleOrLength), except that it assumes a scale of zero.
        Parameters:
        parameterName - - the name of the parameter
        x - - the object containing the input parameter value
        targetSqlType - - the SQL type to be sent to the database
        Throws:
        SQLException - - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed CallableStatement
        SQLFeatureNotSupportedException - - if the JDBC driver does not support this data type
      • registerOutParameter

        public void registerOutParameter(int parameterIndex,
                                Object sqlType)
                                  throws SQLException
        Registers the OUT parameter in ordinal position parameterIndex to the JDBC type sqlType. All OUT parameters must be registered before a stored procedure is executed.

        The JDBC type specified by sqlType for an OUT parameter determines the Java type that must be used in the get method to read the value of that parameter.

        If the JDBC type expected to be returned to this output parameter is specific to this particular database, sqlType may be JDBCType.OTHER or a SQLType that is supported by the JDBC driver. The method getObject(int) retrieves the value.

        Parameters:
        parameterIndex - - the first parameter is 1, the second is 2, and so on
        sqlType - - the JDBC type code defined by SQLType to use to register the OUT Parameter. If the parameter is of JDBC type JDBCType.NUMERIC or JDBCType.DECIMAL, the version of registerOutParameter that accepts a scale value should be used.
        Throws:
        SQLException - - if the parameterIndex is not valid; if a database access error occurs or this method is called on a closed CallableStatement
        SQLFeatureNotSupportedException - - if the JDBC driver does not support this data type
      • registerOutParameter

        public void registerOutParameter(int parameterIndex,
                                Object sqlType,
                                int scale)
                                  throws SQLException
        Registers the parameter in ordinal position parameterIndex to be of JDBC type sqlType. All OUT parameters must be registered before a stored procedure is executed.

        The JDBC type specified by sqlType for an OUT parameter determines the Java type that must be used in the get method to read the value of that parameter.

        This version of registerOutParameter should be used when the parameter is of JDBC type JDBCType.NUMERIC or JDBCType.DECIMAL.

        Parameters:
        parameterIndex - - the first parameter is 1, the second is 2, and so on
        sqlType - - the JDBC type code defined by SQLType to use to register the OUT Parameter.
        scale - - the desired number of digits to the right of the decimal point. It must be greater than or equal to zero.
        Throws:
        SQLException - - if the parameterIndex is not valid; if a database access error occurs or this method is called on a closed CallableStatement
        SQLFeatureNotSupportedException - - if the JDBC driver does not support this data type
      • registerOutParameter

        public void registerOutParameter(int parameterIndex,
                                Object sqlType,
                                String typeName)
                                  throws SQLException
        Registers the designated output parameter. This version of the method registerOutParameter should be used for a user-defined or REF output parameter. Examples of user-defined types include: STRUCT, DISTINCT, JAVA_OBJECT, and named array types.

        All OUT parameters must be registered before a stored procedure is executed.

        For a user-defined parameter, the fully-qualified SQL type name of the parameter should also be given, while a REF parameter requires that the fully-qualified type name of the referenced type be given. A JDBC driver that does not need the type code and type name information may ignore it. To be portable, however, applications should always provide these values for user-defined and REF parameters. Although it is intended for user-defined and REF parameters, this method may be used to register a parameter of any JDBC type. If the parameter does not have a user-defined or REF type, the typeName parameter is ignored.

        Note: When reading the value of an out parameter, you must use the getter method whose Java type corresponds to the parameter's registered SQL type.

        Parameters:
        parameterIndex - - the first parameter is 1, the second is 2,...
        sqlType - - the JDBC type code defined by SQLType to use to register the OUT Parameter.
        typeName - - the fully-qualified name of an SQL structured type
        Throws:
        SQLException - - if the parameterIndex is not valid; if a database access error occurs or this method is called on a closed CallableStatement
        SQLFeatureNotSupportedException - - if the JDBC driver does not support this data type
      • registerOutParameter

        public void registerOutParameter(String parameterName,
                                Object sqlType)
                                  throws SQLException
        Registers the OUT parameter named parameterName to the JDBC type sqlType. All OUT parameters must be registered before a stored procedure is executed.

        The JDBC type specified by sqlType for an OUT parameter determines the Java type that must be used in the get method to read the value of that parameter.

        If the JDBC type expected to be returned to this output parameter is specific to this particular database, sqlType should be JDBCType.OTHER or a SQLType that is supported by the JDBC driver.. The method getObject(int) retrieves the value.

        Parameters:
        parameterName - - the name of the parameter
        sqlType - - the JDBC type code defined by SQLType to use to register the OUT Parameter. If the parameter is of JDBC type JDBCType.NUMERIC or JDBCType.DECIMAL, the version of registerOutParameter that accepts a scale value should be used.
        Throws:
        SQLException - - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed CallableStatement
        SQLFeatureNotSupportedException - - if the JDBC driver does not support this data type or if the JDBC driver does not support this method
      • registerOutParameter

        public void registerOutParameter(String parameterName,
                                Object sqlType,
                                int scale)
                                  throws SQLException
        Registers the parameter named parameterName to be of JDBC type sqlType. All OUT parameters must be registered before a stored procedure is executed.

        The JDBC type specified by sqlType for an OUT parameter determines the Java type that must be used in the get method to read the value of that parameter.

        This version of registerOutParameter should be used when the parameter is of JDBC type JDBCType.NUMERIC or JDBCType.DECIMAL.

        Parameters:
        parameterName - - the name of the parameter
        sqlType - - the JDBC type code defined by SQLType to use to register the OUT Parameter.
        scale - - the desired number of digits to the right of the decimal point. It must be greater than or equal to zero.
        Throws:
        SQLException - - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed CallableStatement
        SQLFeatureNotSupportedException - - if the JDBC driver does not support this data type or if the JDBC driver does not support this method
      • registerOutParameter

        public void registerOutParameter(String parameterName,
                                Object sqlType,
                                String typeName)
                                  throws SQLException
        Registers the designated output parameter. This version of the method registerOutParameter should be used for a user-named or REF output parameter. Examples of user-named types include: STRUCT, DISTINCT, JAVA_OBJECT, and named array types.

        All OUT parameters must be registered before a stored procedure is executed.

        For a user-named parameter the fully-qualified SQL type name of the parameter should also be given, while a REF parameter requires that the fully-qualified type name of the referenced type be given. A JDBC driver that does not need the type code and type name information may ignore it. To be portable, however, applications should always provide these values for user-named and REF parameters. Although it is intended for user-named and REF parameters, this method may be used to register a parameter of any JDBC type. If the parameter does not have a user-named or REF type, the typeName parameter is ignored.

        Note: When reading the value of an out parameter, you must use the getXXX method whose Java type XXX corresponds to the parameter's registered SQL type.

        Parameters:
        parameterName - - the name of the parameter
        sqlType - - the JDBC type code defined by SQLType to use to register the OUT Parameter.
        typeName - - the fully-qualified name of an SQL structured type
        Throws:
        SQLException - - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed CallableStatement
        SQLFeatureNotSupportedException - - if the JDBC driver does not support this data type or if the JDBC driver does not support this method