7047 lines · 303.9 KB · Java
RawDownload
     *             on the insert row, (3) not all non-nullable columns in     *             the insert row have been given a value, or (4) this     *             rowset does not currently have a valid connection,     *             prepared statement, and result set     */    public void insertRow() throws SQLException {        checkState();         rs.insertRow();        notifyRowChanged();    }     /**     * Updates the underlying database with the new contents of the     * current row of this rowset's <code>ResultSet</code> object     * and notifies listeners that a row has changed.     * This method cannot be called when the cursor is on the insert row.     *     * @throws SQLException if (1) a database access error occurs,     *            (2) this method is called when the cursor is     *             on the insert row, (3) the concurrency of the result     *             set is <code>ResultSet.CONCUR_READ_ONLY</code>, or     *             (4) this rowset does not currently have a valid connection,     *             prepared statement, and result set     */    public void updateRow() throws SQLException {        checkState();         rs.updateRow();        notifyRowChanged();    }     /**     * Deletes the current row from this rowset's <code>ResultSet</code> object     * and from the underlying database and also notifies listeners that a row     * has changed.  This method cannot be called when the cursor is on the insert     * row.     *     * @throws SQLException if a database access error occurs     * or if this method is called when the cursor is on the insert row     * @throws SQLException if (1) a database access error occurs,     *            (2) this method is called when the cursor is before the     *            first row, after the last row, or on the insert row,     *            (3) the concurrency of this rowset's result     *            set is <code>ResultSet.CONCUR_READ_ONLY</code>, or     *            (4) this rowset does not currently have a valid connection,     *            prepared statement, and result set     */    public void deleteRow() throws SQLException {        checkState();         rs.deleteRow();        notifyRowChanged();    }     /**     * Refreshes the current row of this rowset's <code>ResultSet</code>     * object with its most recent value in the database.  This method     * cannot be called when the cursor is on the insert row.     *     * <P>The <code>refreshRow</code> method provides a way for an     * application to explicitly tell the JDBC driver to refetch     * a row(s) from the database.  An application may want to call     * <code>refreshRow</code> when caching or prefetching is being     * done by the JDBC driver to fetch the latest value of a row     * from the database.  The JDBC driver may actually refresh multiple     * rows at once if the fetch size is greater than one.     *     * <P> All values are refetched subject to the transaction isolation     * level and cursor sensitivity.  If <code>refreshRow</code> is called after     * calling an <code>updateXXX</code> method, but before calling     * the method <code>updateRow</code>, then the     * updates made to the row are lost.  Calling the method     * <code>refreshRow</code> frequently will likely slow performance.     *     * @throws SQLException if (1) a database access error occurs,     *            (2) this method is called when the cursor is     *             on the insert row, or (3) this rowset does not     *             currently have a valid connection, prepared statement,     *             and result set     *     */    public void refreshRow() throws SQLException {        checkState();         rs.refreshRow();    }     /**     * Cancels the updates made to the current row in this     * <code>ResultSet</code> object and notifies listeners that a row     * has changed. This method may be called after calling an     * <code>updateXXX</code> method(s) and before calling     * the method <code>updateRow</code> to roll back     * the updates made to a row.  If no updates have been made or     * <code>updateRow</code> has already been called, this method has no     * effect.     *     * @throws SQLException if (1) a database access error occurs,     *            (2) this method is called when the cursor is     *             on the insert row, or (3) this rowset does not     *             currently have a valid connection, prepared statement,     *             and result set     */    public void cancelRowUpdates() throws SQLException {        checkState();         rs.cancelRowUpdates();         notifyRowChanged();    }     /**     * Moves the cursor to the insert row.  The current cursor position is     * remembered while the cursor is positioned on the insert row.     *     * The insert row is a special row associated with an updatable     * result set.  It is essentially a buffer where a new row may     * be constructed by calling the <code>updateXXX</code> methods prior to     * inserting the row into the result set.     *     * Only the <code>updateXXX</code>, <code>getXXX</code>,     * and <code>insertRow</code> methods may be     * called when the cursor is on the insert row.  All of the columns in     * a result set must be given a value each time this method is     * called before calling <code>insertRow</code>.     * An <code>updateXXX</code> method must be called before a     * <code>getXXX</code> method can be called on a column value.     *     * @throws SQLException if (1) a database access error occurs,     *            (2) this rowset's <code>ResultSet</code> object is     *             not updatable, or (3) this rowset does not     *             currently have a valid connection, prepared statement,     *             and result set     *     */    public void moveToInsertRow() throws SQLException {        checkState();         rs.moveToInsertRow();    }     /**     * Moves the cursor to the remembered cursor position, usually the     * current row.  This method has no effect if the cursor is not on     * the insert row.     *     * @throws SQLException if (1) a database access error occurs,     *            (2) this rowset's <code>ResultSet</code> object is     *             not updatable, or (3) this rowset does not     *             currently have a valid connection, prepared statement,     *             and result set     */    public void moveToCurrentRow() throws SQLException {        checkState();         rs.moveToCurrentRow();    }     /**     * Returns the <code>Statement</code> object that produced this     * <code>ResultSet</code> object.     * If the result set was generated some other way, such as by a     * <code>DatabaseMetaData</code> method, this method returns     * <code>null</code>.     *     * @return the <code>Statment</code> object that produced     * this rowset's <code>ResultSet</code> object or <code>null</code>     * if the result set was produced some other way     * @throws SQLException if a database access error occurs     */    public java.sql.Statement getStatement() throws SQLException {         if(rs != null)        {           return rs.getStatement();        } else {           return null;        }    }     /**     * Returns the value of the designated column in the current row     * of this rowset's <code>ResultSet</code> object as an <code>Object</code>.     * This method uses the given <code>Map</code> object     * for the custom mapping of the     * SQL structured or distinct type that is being retrieved.     *     * @param i the first column is 1, the second is 2, and so on     * @param map a <code>java.util.Map</code> object that contains the mapping     * from SQL type names to classes in the Java programming language     * @return an <code>Object</code> in the Java programming language     * representing the SQL value     * @throws SQLException if (1) a database access error occurs     *            or (2) this rowset does not currently have a valid connection,     *            prepared statement, and result set     */    public Object getObject(int i, java.util.Map<String,Class<?>> map)        throws SQLException    {        checkState();         return rs.getObject(i, map);    }     /**     * Returns the value of the designated column in the current row     * of this rowset's <code>ResultSet</code> object as a <code>Ref</code> object.     *     * @param i the first column is 1, the second is 2, and so on     * @return a <code>Ref</code> object representing an SQL <code>REF</code> value     * @throws SQLException if (1) a database access error occurs     *            or (2) this rowset does not currently have a valid connection,     *            prepared statement, and result set     */    public Ref getRef(int i) throws SQLException {        checkState();         return rs.getRef(i);    }      /**     * Returns the value of the designated column in the current row     * of this rowset's <code>ResultSet</code> object as a <code>Blob</code> object.     *     * @param i the first column is 1, the second is 2, and so on     * @return a <code>Blob</code> object representing the SQL <code>BLOB</code>     *         value in the specified column     * @throws SQLException if (1) a database access error occurs     *            or (2) this rowset does not currently have a valid connection,     *            prepared statement, and result set     */    public Blob getBlob(int i) throws SQLException {        checkState();         return rs.getBlob(i);    }     /**     * Returns the value of the designated column in the current row     * of this rowset's <code>ResultSet</code> object as a <code>Clob</code> object.     *     * @param i the first column is 1, the second is 2, and so on     * @return a <code>Clob</code> object representing the SQL <code>CLOB</code>     *         value in the specified column     * @throws SQLException if (1) a database access error occurs     *            or (2) this rowset does not currently have a valid connection,     *            prepared statement, and result set     */    public Clob getClob(int i) throws SQLException {        checkState();         return rs.getClob(i);    }     /**     * Returns the value of the designated column in the current row     * of this rowset's <code>ResultSet</code> object as an <code>Array</code> object.     *     * @param i the first column is 1, the second is 2, and so on.     * @return an <code>Array</code> object representing the SQL <code>ARRAY</code>     *         value in the specified column     * @throws SQLException if (1) a database access error occurs     *            or (2) this rowset does not currently have a valid connection,     *            prepared statement, and result set     */    public Array getArray(int i) throws SQLException {        checkState();         return rs.getArray(i);    }     /**     * Returns the value of the designated column in the current row     * of this rowset's <code>ResultSet</code> object as an <code>Object</code>.     * This method uses the specified <code>Map</code> object for     * custom mapping if appropriate.     *     * @param colName the name of the column from which to retrieve the value     * @param map a <code>java.util.Map</code> object that contains the mapping     * from SQL type names to classes in the Java programming language     * @return an <code>Object</code> representing the SQL     *         value in the specified column     * @throws SQLException if (1) a database access error occurs     *            or (2) this rowset does not currently have a valid connection,     *            prepared statement, and result set     */    public Object getObject(String colName, java.util.Map<String,Class<?>> map)        throws SQLException    {        return getObject(findColumn(colName), map);    }     /**     * Returns the value of the designated column in the current row     * of this rowset's <code>ResultSet</code> object as a <code>Ref</code> object.     *     * @param colName the column name     * @return a <code>Ref</code> object representing the SQL <code>REF</code> value in     *         the specified column     * @throws SQLException if (1) a database access error occurs     *            or (2) this rowset does not currently have a valid connection,     *            prepared statement, and result set     */    public Ref getRef(String colName) throws SQLException {        return getRef(findColumn(colName));    }     /**     * Returns the value of the designated column in the current row     * of this rowset's <code>ResultSet</code> object as a <code>Blob</code> object.     *     * @param colName the name of the column from which to retrieve the value     * @return a <code>Blob</code> object representing the SQL <code>BLOB</code>     *         value in the specified column     * @throws SQLException if (1) a database access error occurs     *            or (2) this rowset does not currently have a valid connection,     *            prepared statement, and result set     */    public Blob getBlob(String colName) throws SQLException {        return getBlob(findColumn(colName));    }     /**     * Returns the value of the designated column in the current row     * of this rowset's <code>ResultSet</code> object as a <code>Clob</code> object.     *     * @param colName the name of the column from which to retrieve the value     * @return a <code>Clob</code> object representing the SQL <code>CLOB</code>     *         value in the specified column     * @throws SQLException if (1) a database access error occurs     *            or (2) this rowset does not currently have a valid connection,     *            prepared statement, and result set     */    public Clob getClob(String colName) throws SQLException {        return getClob(findColumn(colName));    }     /**     * Returns the value of the designated column in the current row     * of this rowset's <code>ResultSet</code> object as an <code>Array</code> object.     *     * @param colName the name of the column from which to retrieve the value     * @return an <code>Array</code> object representing the SQL <code>ARRAY</code>     *         value in the specified column     * @throws SQLException if (1) a database access error occurs     *            or (2) this rowset does not currently have a valid connection,     *            prepared statement, and result set     */    public Array getArray(String colName) throws SQLException {        return getArray(findColumn(colName));    }     /**     * Returns the value of the designated column in the current row     * of this rowset's <code>ResultSet</code> object as a <code>java.sql.Date</code>     * object. This method uses the given calendar to construct an appropriate     * millisecond value for the date if the underlying database does not store     * timezone information.     *     * @param columnIndex the first column is 1, the second is 2, and so on     * @param cal the <code>java.util.Calendar</code> object     *        to use in constructing the date     * @return the column value as a <code>java.sql.Date</code> object;     *         if the value is SQL <code>NULL</code>,     *         the value returned is <code>null</code>     * @throws SQLException if (1) a database access error occurs     *            or (2) this rowset does not currently have a valid connection,     *            prepared statement, and result set     */    public java.sql.Date getDate(int columnIndex, Calendar cal) throws SQLException {        checkState();         return rs.getDate(columnIndex, cal);    }     /**     * Returns the value of the designated column in the current row     * of this rowset's <code>ResultSet</code> object as a <code>java.sql.Date</code>     * object. This method uses the given calendar to construct an appropriate     * millisecond value for the date if the underlying database does not store     * timezone information.     *     * @param columnName the SQL name of the column from which to retrieve the value     * @param cal the <code>java.util.Calendar</code> object     *        to use in constructing the date     * @return the column value as a <code>java.sql.Date</code> object;     *         if the value is SQL <code>NULL</code>,     *         the value returned is <code>null</code>     * @throws SQLException if a database access error occurs     *            or this rowset does not currently have a valid connection,     *            prepared statement, and result set     *     */    public java.sql.Date getDate(String columnName, Calendar cal) throws SQLException {        return getDate(findColumn(columnName), cal);    }     /**     * Returns the value of the designated column in the current row     * of this rowset's <code>ResultSet</code> object as a <code>java.sql.Time</code>     * object. This method uses the given calendar to construct an appropriate     * millisecond value for the date if the underlying database does not store     * timezone information.     *     * @param columnIndex the first column is 1, the second is 2, and so on     * @param cal the <code>java.util.Calendar</code> object     *        to use in constructing the time     * @return the column value as a <code>java.sql.Time</code> object;     *         if the value is SQL <code>NULL</code>,     *         the value returned is <code>null</code> in the Java programming language     * @throws SQLException if a database access error occurs     *            or this rowset does not currently have a valid connection,     *            prepared statement, and result set     */    public java.sql.Time getTime(int columnIndex, Calendar cal) throws SQLException {        checkState();         return rs.getTime(columnIndex, cal);    }     /**     * Returns the value of the designated column in the current row     * of this rowset's <code>ResultSet</code> object as a <code>java.sql.Time</code>     * object. This method uses the given calendar to construct an appropriate     * millisecond value for the date if the underlying database does not store     * timezone information.     *     * @param columnName the SQL name of the column     * @param cal the <code>java.util.Calendar</code> object     *        to use in constructing the time     * @return the column value as a <code>java.sql.Time</code> object;     *         if the value is SQL <code>NULL</code>,     *         the value returned is <code>null</code> in the Java programming language     * @throws SQLException if a database access error occurs     *            or this rowset does not currently have a valid connection,     *            prepared statement, and result set     */    public java.sql.Time getTime(String columnName, Calendar cal) throws SQLException {        return getTime(findColumn(columnName), cal);    }     /**     * Returns the value of the designated column in the current row     * of this rowset's <code>ResultSet</code> object as a     * <code>java.sql.Timestamp</code> object.     * This method uses the given calendar to construct an appropriate millisecond     * value for the timestamp if the underlying database does not store     * timezone information.     *     * @param columnIndex the first column is 1, the second is 2, and so on     * @param cal the <code>java.util.Calendar</code> object     *        to use in constructing the timestamp     * @return the column value as a <code>java.sql.Timestamp</code> object;     *         if the value is SQL <code>NULL</code>,     *         the value returned is <code>null</code>     * @throws SQLException if a database access error occurs     *            or this rowset does not currently have a valid connection,     *            prepared statement, and result set     */    public java.sql.Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException {        checkState();         return rs.getTimestamp(columnIndex, cal);    }     /**     * Returns the value of the designated column in the current row     * of this rowset's <code>ResultSet</code> object as a     * <code>java.sql.Timestamp</code> object.     * This method uses the given calendar to construct an appropriate millisecond     * value for the timestamp if the underlying database does not store     * timezone information.     *     * @param columnName the SQL name of the column     * @param cal the <code>java.util.Calendar</code> object     *        to use in constructing the timestamp     * @return the column value as a <code>java.sql.Timestamp</code> object;     *         if the value is SQL <code>NULL</code>,     *         the value returned is <code>null</code>     * @throws SQLException if a database access error occurs     *            or this rowset does not currently have a valid connection,     *            prepared statement, and result set     */    public java.sql.Timestamp getTimestamp(String columnName, Calendar cal) throws SQLException {        return getTimestamp(findColumn(columnName), cal);    }      /**     * Sets the designated column in either the current row or the insert     * row of this <code>JdbcRowSetImpl</code> object with the given     * <code>double</code> value.     *     * This method updates a column value in either the current row or     * the insert row of this rowset, but it does not update the     * database.  If the cursor is on a row in the rowset, the     * method {@link #updateRow} must be called to update the database.     * If the cursor is on the insert row, the method {@link #insertRow}

Lines 3001–3500 of 7047. Previous lines