4512 lines · 210.7 KB · Java
RawDownload
   *   * @param parameterIndex the first parameter is 1, the second is 2, ...   * @param reader the <code>java.io.Reader</code> object that contains the   *        Unicode data   * @exception SQLException if a database access error occurs or   * this method is called on a closed <code>PreparedStatement</code>   * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method   * @since 1.6   */  public void setCharacterStream(int parameterIndex,                          java.io.Reader reader) throws SQLException {      throw new SQLFeatureNotSupportedException("Feature not supported");  }     /**     * Sets the designated parameter to an <code>Object</code> in the Java     * programming language. The second parameter must be an     * <code>Object</code> type.  For integral values, the     * <code>java.lang</code> equivalent     * objects should be used. For example, use the class <code>Integer</code>     * for an <code>int</code>.     * <P>     * The driver converts this object to the specified     * target SQL type before sending it to the database.     * If the object has a custom mapping (is of a class implementing     * <code>SQLData</code>), the driver should call the method     * <code>SQLData.writeSQL</code> to write the object to the SQL     * data stream. If, on the other hand, the object is of a class     * implementing <code>Ref</code>, <code>Blob</code>, <code>Clob</code>,     * <code>Struct</code>, or <code>Array</code>,     * the driver should pass it to the database as a value of the     * corresponding SQL type.     * <P>     * <p>Note that this method may be used to pass database-     * specific abstract data types.     * <P>     * The parameter value set by this method is stored internally and     * will be supplied as the appropriate parameter in this <code>RowSet</code     * object's command when the method <code>execute</code> is called.     * Methods such as <code>execute</code> and <code>populate</code> must be     * provided in any class that extends this class and implements one or     * more of the standard JSR-114 <code>RowSet</code> interfaces.     * <P>     * NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method     * as it is undefined in this class.     * <P>     * Calls made to the method <code>getParams</code> after this version of     * <code>setObject</code>     * has been called will return an array containing the parameter values that     * have been set.  In that array, the element that represents the values     * set with this method will itself be an array. The first element of that array     * is the given <code>Object</code> instance, and the     * second element is the value set for <i>targetSqlType</i>.  The     * third element is the value set for <i>scale</i>, which the driver will     * ignore if the type of the object being set is not     * <code>java.sql.Types.NUMERIC</code> or <code>java.sql.Types.DECIMAL</code>.     * The parameter number is indicated by an element's position in the array     * returned by the method <code>getParams</code>,     * with the first element being the value for the first placeholder parameter, the     * second element being the value for the second placeholder parameter, and so on.     * In other words, if the object being set is the value for the second     * placeholder parameter, the array containing it will be the second element in     * the array returned by <code>getParams</code>.     *<P>     * Note that because the numbering of elements in an array starts at zero,     * the array element that corresponds to placeholder parameter number     * <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.     *     *     * @param parameterIndex the ordinal number of the placeholder parameter     *        in this <code>RowSet</code> object's command that is to be set.     *        The first parameter is 1, the second is 2, and so on; must be     *        <code>1</code> or greater     * @param x the <code>Object</code> containing the input parameter value;     *        must be an <code>Object</code> type     * @param targetSqlType the SQL type (as defined in <code>java.sql.Types</code>)     *        to be sent to the database. The <code>scale</code> argument may     *        further qualify this type. If a non-standard <i>targetSqlType</i>     *        is supplied, this method will not throw a <code>SQLException</code>.     *        This allows implicit support for non-standard SQL types.     * @param scale for the types <code>java.sql.Types.DECIMAL</code> and     *        <code>java.sql.Types.NUMERIC</code>, this is the number     *        of digits after the decimal point.  For all other types, this     *        value will be ignored.     * @throws SQLException if an error occurs or the parameter index is out of bounds     * @see #getParams     */    public void setObject(int parameterIndex, Object x, int targetSqlType, int scale) throws SQLException {        Object obj[];        checkParamIndex(parameterIndex);         obj = new Object[3];        obj[0] = x;        obj[1] = Integer.valueOf(targetSqlType);        obj[2] = Integer.valueOf(scale);        if(params == null){             throw new SQLException("Set initParams() before setObject");        }        params.put(Integer.valueOf(parameterIndex - 1), obj);    }     /**     * Sets the value of the designated parameter with the given     * <code>Object</code> value.     * This method is like <code>setObject(int parameterIndex, Object x, int     * targetSqlType, int scale)</code> except that it assumes a scale of zero.     * <P>     * The parameter value set by this method is stored internally and     * will be supplied as the appropriate parameter in this <code>RowSet</code>     * object's command when the method <code>execute</code> is called.     * Methods such as <code>execute</code> and <code>populate</code> must be     * provided in any class that extends this class and implements one or     * more of the standard JSR-114 <code>RowSet</code> interfaces.     * <P>     * NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method     * as it is undefined in this class.     * <P>     * Calls made to the method <code>getParams</code> after this version of     * <code>setObject</code>     * has been called will return an array containing the parameter values that     * have been set.  In that array, the element that represents the values     * set with this method will itself be an array. The first element of that array     * is the given <code>Object</code> instance.     * The second element is the value set for <i>targetSqlType</i>.     * The parameter number is indicated by an element's position in the array     * returned by the method <code>getParams</code>,     * with the first element being the value for the first placeholder parameter, the     * second element being the value for the second placeholder parameter, and so on.     * In other words, if the object being set is the value for the second     * placeholder parameter, the array containing it will be the second element in     * the array returned by <code>getParams</code>.     * <P>     * Note that because the numbering of elements in an array starts at zero,     * the array element that corresponds to placeholder parameter number     * <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.     *     * @param parameterIndex the ordinal number of the placeholder parameter     *        in this <code>RowSet</code> object's command that is to be set.     *        The first parameter is 1, the second is 2, and so on; must be     *        <code>1</code> or greater     * @param x the <code>Object</code> containing the input parameter value;     *        must be an <code>Object</code> type     * @param targetSqlType the SQL type (as defined in <code>java.sql.Types</code>)     *        to be sent to the database. If a non-standard <i>targetSqlType</i>     *        is supplied, this method will not throw a <code>SQLException</code>.     *        This allows implicit support for non-standard SQL types.     * @throws SQLException if an error occurs or the parameter index     *        is out of bounds     * @see #getParams     */    public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException {        Object obj[];        checkParamIndex(parameterIndex);         obj = new Object[2];        obj[0] = x;        obj[1] = Integer.valueOf(targetSqlType);        if (params == null){             throw new SQLException("Set initParams() before setObject");        }        params.put(Integer.valueOf(parameterIndex - 1), obj);    }     /**     * Sets the designated parameter to an <code>Object</code> in the Java     * programming language. The second parameter must be an     * <code>Object</code>     * type.  For integral values, the <code>java.lang</code> equivalent     * objects should be used. For example, use the class <code>Integer</code>     * for an <code>int</code>.     * <P>     * The JDBC specification defines a standard mapping from     * Java <code>Object</code> types to SQL types.  The driver will     * use this standard mapping to  convert the given object     * to its corresponding SQL type before sending it to the database.     * If the object has a custom mapping (is of a class implementing     * <code>SQLData</code>), the driver should call the method     * <code>SQLData.writeSQL</code> to write the object to the SQL     * data stream.     * <P>     * If, on the other hand, the object is of a class     * implementing <code>Ref</code>, <code>Blob</code>, <code>Clob</code>,     * <code>Struct</code>, or <code>Array</code>,     * the driver should pass it to the database as a value of the     * corresponding SQL type.     * <P>     * This method throws an exception if there     * is an ambiguity, for example, if the object is of a class     * implementing more than one interface.     * <P>     * Note that this method may be used to pass database-specific     * abstract data types.     * <P>     * The parameter value set by this method is stored internally and     * will be supplied as the appropriate parameter in this <code>RowSet</code>     * object's command when the method <code>execute</code> is called.     * Methods such as <code>execute</code> and <code>populate</code> must be     * provided in any class that extends this class and implements one or     * more of the standard JSR-114 <code>RowSet</code> interfaces.     * <p>     * NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method     * as it is undefined in this class.     * <P>     * After this method has been called, a call to the     * method <code>getParams</code>     * will return an object array of the current command parameters, which will     * include the <code>Object</code> set for placeholder parameter number     * <code>parameterIndex</code>.     * Note that because the numbering of elements in an array starts at zero,     * the array element that corresponds to placeholder parameter number     * <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.     *     * @param parameterIndex the ordinal number of the placeholder parameter     *        in this <code>RowSet</code> object's command that is to be set.     *        The first parameter is 1, the second is 2, and so on; must be     *        <code>1</code> or greater     * @param x the object containing the input parameter value     * @throws SQLException if an error occurs the     *                         parameter index is out of bounds, or there     *                         is ambiguity in the implementation of the     *                         object being set     * @see #getParams     */    public void setObject(int parameterIndex, Object x) throws SQLException {        checkParamIndex(parameterIndex);        if (params == null) {             throw new SQLException("Set initParams() before setObject");        }        params.put(Integer.valueOf(parameterIndex - 1), x);    }     /**     * Sets the designated parameter to the given <code>Ref</code> object in     * the Java programming language.  The driver converts this to an SQL     * <code>REF</code> value when it sends it to the database. Internally, the     * <code>Ref</code> is represented as a <code>SerialRef</code> to ensure     * serializability.     * <P>     * The parameter value set by this method is stored internally and     * will be supplied as the appropriate parameter in this <code>RowSet</code>     * object's command when the method <code>execute</code> is called.     * Methods such as <code>execute</code> and <code>populate</code> must be     * provided in any class that extends this class and implements one or     * more of the standard JSR-114 <code>RowSet</code> interfaces.     * <p>     * NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method     * as it is undefined in this class.     * <p>     * After this method has been called, a call to the     * method <code>getParams</code>     * will return an object array of the current command parameters, which will     * include the <code>Ref</code> object set for placeholder parameter number     * <code>parameterIndex</code>.     * Note that because the numbering of elements in an array starts at zero,     * the array element that corresponds to placeholder parameter number     * <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.     *     * @param parameterIndex the ordinal number of the placeholder parameter     *        in this <code>RowSet</code> object's command that is to be set.     *        The first parameter is 1, the second is 2, and so on; must be     *        <code>1</code> or greater     * @param ref a <code>Ref</code> object representing an SQL <code>REF</code>     *         value; cannot be null     * @throws SQLException if an error occurs; the parameter index is out of     *         bounds or the <code>Ref</code> object is <code>null</code>; or     *         the <code>Ref</code> object returns a <code>null</code> base type     *         name.     * @see #getParams     * @see javax.sql.rowset.serial.SerialRef     */    public void setRef (int parameterIndex, Ref ref) throws SQLException {        checkParamIndex(parameterIndex);        if (params == null) {             throw new SQLException("Set initParams() before setRef");        }        params.put(Integer.valueOf(parameterIndex - 1), new SerialRef(ref));    }     /**     * Sets the designated parameter to the given <code>Blob</code> object in     * the Java programming language.  The driver converts this to an SQL     * <code>BLOB</code> value when it sends it to the database. Internally,     * the <code>Blob</code> is represented as a <code>SerialBlob</code>     * to ensure serializability.     * <P>     * The parameter value set by this method is stored internally and     * will be supplied as the appropriate parameter in this <code>RowSet</code>     * object's command when the method <code>execute</code> is called.     * Methods such as <code>execute</code> and <code>populate</code> must be     * provided in any class that extends this class and implements one or     * more of the standard JSR-114 <code>RowSet</code> interfaces.     * NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method     * as it is undefined in this class.     * <p>     * After this method has been called, a call to the     * method <code>getParams</code>     * will return an object array of the current command parameters, which will     * include the <code>Blob</code> object set for placeholder parameter number     * <code>parameterIndex</code>.     * Note that because the numbering of elements in an array starts at zero,     * the array element that corresponds to placeholder parameter number     * <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.     *     * @param parameterIndex the ordinal number of the placeholder parameter     *        in this <code>RowSet</code> object's command that is to be set.     *        The first parameter is 1, the second is 2, and so on; must be     *        <code>1</code> or greater     * @param x a <code>Blob</code> object representing an SQL     *          <code>BLOB</code> value     * @throws SQLException if an error occurs or the     *                         parameter index is out of bounds     * @see #getParams     * @see javax.sql.rowset.serial.SerialBlob     */    public void setBlob (int parameterIndex, Blob x) throws SQLException {        checkParamIndex(parameterIndex);        if(params == null){             throw new SQLException("Set initParams() before setBlob");        }        params.put(Integer.valueOf(parameterIndex - 1), new SerialBlob(x));    }     /**     * Sets the designated parameter to the given <code>Clob</code> object in     * the Java programming language.  The driver converts this to an SQL     * <code>CLOB</code> value when it sends it to the database. Internally, the     * <code>Clob</code> is represented as a <code>SerialClob</code> to ensure     * serializability.     * <P>     * The parameter value set by this method is stored internally and     * will be supplied as the appropriate parameter in this <code>RowSet</code>     * object's command when the method <code>execute</code> is called.     * Methods such as <code>execute</code> and <code>populate</code> must be     * provided in any class that extends this class and implements one or     * more of the standard JSR-114 <code>RowSet</code> interfaces.     * <p>     * NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method     * as it is undefined in this class.     * <p>     * After this method has been called, a call to the     * method <code>getParams</code>     * will return an object array of the current command parameters, which will     * include the <code>Clob</code> object set for placeholder parameter number     * <code>parameterIndex</code>.     * Note that because the numbering of elements in an array starts at zero,     * the array element that corresponds to placeholder parameter number     * <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.     *     * @param parameterIndex the ordinal number of the placeholder parameter     *     in this <code>RowSet</code> object's command that is to be set.     *     The first parameter is 1, the second is 2, and so on; must be     *     <code>1</code> or greater     * @param x a <code>Clob</code> object representing an SQL     *     <code>CLOB</code> value; cannot be null     * @throws SQLException if an error occurs; the parameter index is out of     *     bounds or the <code>Clob</code> is null     * @see #getParams     * @see javax.sql.rowset.serial.SerialBlob     */    public void setClob (int parameterIndex, Clob x) throws SQLException {        checkParamIndex(parameterIndex);        if(params == null){             throw new SQLException("Set initParams() before setClob");        }        params.put(Integer.valueOf(parameterIndex - 1), new SerialClob(x));    }     /**     * Sets the designated parameter to an <code>Array</code> object in the     * Java programming language.  The driver converts this to an SQL     * <code>ARRAY</code> value when it sends it to the database. Internally,     * the <code>Array</code> is represented as a <code>SerialArray</code>     * to ensure serializability.     * <P>     * The parameter value set by this method is stored internally and     * will be supplied as the appropriate parameter in this <code>RowSet</code>     * object's command when the method <code>execute</code> is called.     * Methods such as <code>execute</code> and <code>populate</code> must be     * provided in any class that extends this class and implements one or     * more of the standard JSR-114 <code>RowSet</code> interfaces.     * <P>     * Note: <code>JdbcRowSet</code> does not require the <code>populate</code> method     * as it is undefined in this class.     * <p>     * After this method has been called, a call to the     * method <code>getParams</code>     * will return an object array of the current command parameters, which will     * include the <code>Array</code> object set for placeholder parameter number     * <code>parameterIndex</code>.     * Note that because the numbering of elements in an array starts at zero,     * the array element that corresponds to placeholder parameter number     * <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.     *     * @param parameterIndex the ordinal number of the placeholder parameter     *        in this <code>RowSet</code> object's command that is to be set.     *        The first parameter is 1, the second is 2, and so on; must be     *        <code>1</code> or greater     * @param array an <code>Array</code> object representing an SQL     *        <code>ARRAY</code> value; cannot be null. The <code>Array</code> object     *        passed to this method must return a non-null Object for all     *        <code>getArray()</code> method calls. A null value will cause a     *        <code>SQLException</code> to be thrown.     * @throws SQLException if an error occurs; the parameter index is out of     *        bounds or the <code>ARRAY</code> is null     * @see #getParams     * @see javax.sql.rowset.serial.SerialArray     */    public void setArray (int parameterIndex, Array array) throws SQLException {        checkParamIndex(parameterIndex);        if (params == null){             throw new SQLException("Set initParams() before setArray");        }        params.put(Integer.valueOf(parameterIndex - 1), new SerialArray(array));    }     /**     * Sets the designated parameter to the given <code>java.sql.Date</code>     * object.     * When the DBMS does not store time zone information, the driver will use     * the given <code>Calendar</code> object to construct the SQL <code>DATE</code>     * value to send to the database. With a     * <code>Calendar</code> object, the driver can calculate the date     * taking into account a custom time zone.  If no <code>Calendar</code>     * object is specified, the driver uses the time zone of the Virtual Machine     * that is running the application.     * <P>     * The parameter value set by this method is stored internally and     * will be supplied as the appropriate parameter in this <code>RowSet</code>     * object's command when the method <code>execute</code> is called.     * Methods such as <code>execute</code> and <code>populate</code> must be     * provided in any class that extends this class and implements one or     * more of the standard JSR-114 <code>RowSet</code> interfaces.     * <P>     * NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method     * as it is undefined in this class.     * <P>     * Calls made to the method <code>getParams</code> after this version of     * <code>setDate</code>     * has been called will return an array containing the parameter values that     * have been set.  In that array, the element that represents the values     * set with this method will itself be an array. The first element of that array     * is the given <code>java.sql.Date</code> object.     * The second element is the value set for <i>cal</i>.     * The parameter number is indicated by an element's position in the array     * returned by the method <code>getParams</code>,     * with the first element being the value for the first placeholder parameter, the     * second element being the value for the second placeholder parameter, and so on.     * In other words, if the date being set is the value for the second     * placeholder parameter, the array containing it will be the second element in     * the array returned by <code>getParams</code>.     * <P>     * Note that because the numbering of elements in an array starts at zero,     * the array element that corresponds to placeholder parameter number     * <i>parameterIndex</i> is <i>parameterIndex</i> -1.     *     * @param parameterIndex the ordinal number of the placeholder parameter     *        in this <code>RowSet</code> object's command that is to be set.     *        The first parameter is 1, the second is 2, and so on; must be     *        <code>1</code> or greater     * @param x a <code>java.sql.Date</code> object representing an SQL     *        <code>DATE</code> value     * @param cal a <code>java.util.Calendar</code> object to use when     *        when constructing the date     * @throws SQLException if an error occurs or the     *                         parameter index is out of bounds     * @see #getParams     */    public void setDate(int parameterIndex, java.sql.Date x, Calendar cal) throws SQLException {        Object date[];        checkParamIndex(parameterIndex);         date = new Object[2];        date[0] = x;        date[1] = cal;        if(params == null){             throw new SQLException("Set initParams() before setDate");        }        params.put(Integer.valueOf(parameterIndex - 1), date);    }     /**     * Sets the designated parameter to the given <code>java.sql.Time</code>     * object.  The driver converts this     * to an SQL <code>TIME</code> value when it sends it to the database.     * <P>     * When the DBMS does not store time zone information, the driver will use     * the given <code>Calendar</code> object to construct the SQL <code>TIME</code>     * value to send to the database. With a     * <code>Calendar</code> object, the driver can calculate the date     * taking into account a custom time zone.  If no <code>Calendar</code>     * object is specified, the driver uses the time zone of the Virtual Machine     * that is running the application.     * <P>     * The parameter value set by this method is stored internally and     * will be supplied as the appropriate parameter in this <code>RowSet</code>     * object's command when the method <code>execute</code> is called.     * Methods such as <code>execute</code> and <code>populate</code> must be     * provided in any class that extends this class and implements one or     * more of the standard JSR-114 <code>RowSet</code> interfaces.     * <P>

Lines 2501–3000 of 4512. Previous lines