* This method updates a column value in 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} * must be called, which will insert the new row into both this rowset * and the database. Both of these methods must be called before the * cursor moves to another row. * * @param columnName a <code>String</code> object that must match the * SQL name of a column in this rowset, ignoring case * @param x the new column value * @throws SQLException if (1) the given column name does not match the * name of a column in this rowset, (2) the cursor is not on * one of this rowset's rows or its insert row, or (3) this * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> */ public void updateShort(String columnName, short x) throws SQLException { updateShort(getColIdxByName(columnName), x); } /** * Sets the designated column in either the current row or the insert * row of this <code>CachedRowSetImpl</code> object with the given * <code>int</code> value. * <P> * This method updates a column value in 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} * must be called, which will insert the new row into both this rowset * and the database. Both of these methods must be called before the * cursor moves to another row. * * @param columnName a <code>String</code> object that must match the * SQL name of a column in this rowset, ignoring case * @param x the new column value * @throws SQLException if (1) the given column name does not match the * name of a column in this rowset, (2) the cursor is not on * one of this rowset's rows or its insert row, or (3) this * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> */ public void updateInt(String columnName, int x) throws SQLException { updateInt(getColIdxByName(columnName), x); } /** * Sets the designated column in either the current row or the insert * row of this <code>CachedRowSetImpl</code> object with the given * <code>long</code> value. * <P> * This method updates a column value in 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} * must be called, which will insert the new row into both this rowset * and the database. Both of these methods must be called before the * cursor moves to another row. * * @param columnName a <code>String</code> object that must match the * SQL name of a column in this rowset, ignoring case * @param x the new column value * @throws SQLException if (1) the given column name does not match the * name of a column in this rowset, (2) the cursor is not on * one of this rowset's rows or its insert row, or (3) this * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> */ public void updateLong(String columnName, long x) throws SQLException { updateLong(getColIdxByName(columnName), x); } /** * Sets the designated column in either the current row or the insert * row of this <code>CachedRowSetImpl</code> object with the given * <code>float</code> value. * <P> * This method updates a column value in 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} * must be called, which will insert the new row into both this rowset * and the database. Both of these methods must be called before the * cursor moves to another row. * * @param columnName a <code>String</code> object that must match the * SQL name of a column in this rowset, ignoring case * @param x the new column value * @throws SQLException if (1) the given column name does not match the * name of a column in this rowset, (2) the cursor is not on * one of this rowset's rows or its insert row, or (3) this * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> */ public void updateFloat(String columnName, float x) throws SQLException { updateFloat(getColIdxByName(columnName), x); } /** * Sets the designated column in either the current row or the insert * row of this <code>CachedRowSetImpl</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} * must be called, which will insert the new row into both this rowset * and the database. Both of these methods must be called before the * cursor moves to another row. * * @param columnName a <code>String</code> object that must match the * SQL name of a column in this rowset, ignoring case * @param x the new column value * @throws SQLException if (1) the given column name does not match the * name of a column in this rowset, (2) the cursor is not on * one of this rowset's rows or its insert row, or (3) this * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> */ public void updateDouble(String columnName, double x) throws SQLException { updateDouble(getColIdxByName(columnName), x); } /** * Sets the designated column in either the current row or the insert * row of this <code>CachedRowSetImpl</code> object with the given * <code>java.math.BigDecimal</code> object. * <P> * This method updates a column value in 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} * must be called, which will insert the new row into both this rowset * and the database. Both of these methods must be called before the * cursor moves to another row. * * @param columnName a <code>String</code> object that must match the * SQL name of a column in this rowset, ignoring case * @param x the new column value * @throws SQLException if (1) the given column name does not match the * name of a column in this rowset, (2) the cursor is not on * one of this rowset's rows or its insert row, or (3) this * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> */ public void updateBigDecimal(String columnName, BigDecimal x) throws SQLException { updateBigDecimal(getColIdxByName(columnName), x); } /** * Sets the designated column in either the current row or the insert * row of this <code>CachedRowSetImpl</code> object with the given * <code>String</code> object. * * 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} * must be called, which will insert the new row into both this rowset * and the database. Both of these methods must be called before the * cursor moves to another row. * * @param columnName a <code>String</code> object that must match the * SQL name of a column in this rowset, ignoring case * @param x the new column value * @throws SQLException if (1) the given column name does not match the * name of a column in this rowset, (2) the cursor is not on * one of this rowset's rows or its insert row, or (3) this * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> */ public void updateString(String columnName, String x) throws SQLException { updateString(getColIdxByName(columnName), x); } /** * Sets the designated column in either the current row or the insert * row of this <code>CachedRowSetImpl</code> object with the given * <code>byte</code> array. * * 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} * must be called, which will insert the new row into both this rowset * and the database. Both of these methods must be called before the * cursor moves to another row. * * @param columnName a <code>String</code> object that must match the * SQL name of a column in this rowset, ignoring case * @param x the new column value * @throws SQLException if (1) the given column name does not match the * name of a column in this rowset, (2) the cursor is not on * one of this rowset's rows or its insert row, or (3) this * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> */ public void updateBytes(String columnName, byte x[]) throws SQLException { updateBytes(getColIdxByName(columnName), x); } /** * Sets the designated column in either the current row or the insert * row of this <code>CachedRowSetImpl</code> object with the given * <code>Date</code> object. * * 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} * must be called, which will insert the new row into both this rowset * and the database. Both of these methods must be called before the * cursor moves to another row. * * @param columnName a <code>String</code> object that must match the * SQL name of a column in this rowset, ignoring case * @param x the new column value * @throws SQLException if (1) the given column name does not match the * name of a column in this rowset, (2) the cursor is not on * one of this rowset's rows or its insert row, (3) the type * of the designated column is not an SQL <code>DATE</code> or * <code>TIMESTAMP</code>, or (4) this rowset is * <code>ResultSet.CONCUR_READ_ONLY</code> */ public void updateDate(String columnName, java.sql.Date x) throws SQLException { updateDate(getColIdxByName(columnName), x); } /** * Sets the designated column in either the current row or the insert * row of this <code>CachedRowSetImpl</code> object with the given * <code>Time</code> object. * * 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} * must be called, which will insert the new row into both this rowset * and the database. Both of these methods must be called before the * cursor moves to another row. * * @param columnName a <code>String</code> object that must match the * SQL name of a column in this rowset, ignoring case * @param x the new column value * @throws SQLException if (1) the given column name does not match the * name of a column in this rowset, (2) the cursor is not on * one of this rowset's rows or its insert row, (3) the type * of the designated column is not an SQL <code>TIME</code> or * <code>TIMESTAMP</code>, or (4) this rowset is * <code>ResultSet.CONCUR_READ_ONLY</code> */ public void updateTime(String columnName, java.sql.Time x) throws SQLException { updateTime(getColIdxByName(columnName), x); } /** * Sets the designated column in either the current row or the insert * row of this <code>CachedRowSetImpl</code> object with the given * <code>Timestamp</code> object. * * 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} * must be called, which will insert the new row into both this rowset * and the database. Both of these methods must be called before the * cursor moves to another row. * * @param columnName a <code>String</code> object that must match the * SQL name of a column in this rowset, ignoring case * @param x the new column value * @throws SQLException if the given column index is out of bounds or * the cursor is not on one of this rowset's rows or its * insert row * @throws SQLException if (1) the given column name does not match the * name of a column in this rowset, (2) the cursor is not on * one of this rowset's rows or its insert row, (3) the type * of the designated column is not an SQL <code>DATE</code>, * <code>TIME</code>, or <code>TIMESTAMP</code>, or (4) this * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> */ public void updateTimestamp(String columnName, java.sql.Timestamp x) throws SQLException { updateTimestamp(getColIdxByName(columnName), x); } /** * Sets the designated column in either the current row or the insert * row of this <code>CachedRowSetImpl</code> object with the given * ASCII stream value. * <P> * 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} * must be called, which will insert the new row into both this rowset * and the database. Both of these methods must be called before the * cursor moves to another row. * * @param columnName a <code>String</code> object that must match the * SQL name of a column in this rowset, ignoring case * @param x the new column value * @param length the number of one-byte ASCII characters in the stream */ public void updateAsciiStream(String columnName, java.io.InputStream x, int length) throws SQLException { updateAsciiStream(getColIdxByName(columnName), x, length); } /** * Sets the designated column in either the current row or the insert * row of this <code>CachedRowSetImpl</code> object with the given * <code>java.io.InputStream</code> object. * <P> * 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} * must be called, which will insert the new row into both this rowset * and the database. Both of these methods must be called before the * cursor moves to another row. * * @param columnName a <code>String</code> object that must match the * SQL name of a column in this rowset, ignoring case * @param x the new column value; must be a <code>java.io.InputStream</code> * containing <code>BINARY</code>, <code>VARBINARY</code>, or * <code>LONGVARBINARY</code> data * @param length the length of the stream in bytes * @throws SQLException if (1) the given column name does not match the * name of a column in this rowset, (2) the cursor is not on * one of this rowset's rows or its insert row, (3) the data * in the stream is not binary, or (4) this rowset is * <code>ResultSet.CONCUR_READ_ONLY</code> */ public void updateBinaryStream(String columnName, java.io.InputStream x, int length) throws SQLException { updateBinaryStream(getColIdxByName(columnName), x, length); } /** * Sets the designated column in either the current row or the insert * row of this <code>CachedRowSetImpl</code> object with the given * <code>java.io.Reader</code> object. * <P> * 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} * must be called, which will insert the new row into both this rowset * and the database. Both of these methods must be called before the * cursor moves to another row. * * @param columnName a <code>String</code> object that must match the * SQL name of a column in this rowset, ignoring case * @param reader the new column value; must be a * <code>java.io.Reader</code> containing <code>BINARY</code>, * <code>VARBINARY</code>, <code>LONGVARBINARY</code>, <code>CHAR</code>, * <code>VARCHAR</code>, or <code>LONGVARCHAR</code> data * @param length the length of the stream in characters * @throws SQLException if (1) the given column name does not match the * name of a column in this rowset, (2) the cursor is not on * one of this rowset's rows or its insert row, (3) the data * in the stream is not a binary or character type, or (4) this * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> */ public void updateCharacterStream(String columnName, java.io.Reader reader, int length) throws SQLException { updateCharacterStream(getColIdxByName(columnName), reader, length); } /** * Sets the designated column in either the current row or the insert * row of this <code>CachedRowSetImpl</code> object with the given * <code>Object</code> value. The <code>scale</code> parameter * indicates the number of digits to the right of the decimal point * and is ignored if the new column value is not a type that will be * mapped to an SQL <code>DECIMAL</code> or <code>NUMERIC</code> value. * <P> * 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} * must be called, which will insert the new row into both this rowset * and the database. Both of these methods must be called before the * cursor moves to another row. * * @param columnName a <code>String</code> object that must match the * SQL name of a column in this rowset, ignoring case * @param x the new column value * @param scale the number of digits to the right of the decimal point (for * <code>DECIMAL</code> and <code>NUMERIC</code> types only) * @throws SQLException if (1) the given column name does not match the * name of a column in this rowset, (2) the cursor is not on * one of this rowset's rows or its insert row, or (3) this * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> */ public void updateObject(String columnName, Object x, int scale) throws SQLException { updateObject(getColIdxByName(columnName), x, scale); } /** * Sets the designated column in either the current row or the insert * row of this <code>CachedRowSetImpl</code> object with the given * <code>Object</code> value. * <P> * 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} * must be called, which will insert the new row into both this rowset * and the database. Both of these methods must be called before the * cursor moves to another row. * * @param columnName a <code>String</code> object that must match the * SQL name of a column in this rowset, ignoring case * @param x the new column value * @throws SQLException if (1) the given column name does not match the * name of a column in this rowset, (2) the cursor is not on * one of this rowset's rows or its insert row, or (3) this * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> */ public void updateObject(String columnName, Object x) throws SQLException { updateObject(getColIdxByName(columnName), x); } /** * Inserts the contents of this <code>CachedRowSetImpl</code> object's insert * row into this rowset immediately following the current row. * If the current row is the * position after the last row or before the first row, the new row will * be inserted at the end of the rowset. This method also notifies * listeners registered with this rowset that the row has changed. * <P> * The cursor must be on the insert row when this method is called. * * @throws SQLException if (1) the cursor is not on the insert row, * (2) one or more of the non-nullable columns in the insert * row has not been given a value, or (3) this rowset is * <code>ResultSet.CONCUR_READ_ONLY</code> */ public void insertRow() throws SQLException { int pos; if (onInsertRow == false || insertRow.isCompleteRow(RowSetMD) == false) { throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.failedins").toString()); } // Added the setting of parameters that are passed // to setXXX methods after an empty CRS Object is // created through RowSetMetaData object Object [] toInsert = getParams(); for(int i = 0;i < toInsert.length; i++) { insertRow.setColumnObject(i+1,toInsert[i]); } Row insRow = new Row(RowSetMD.getColumnCount(), insertRow.getOrigRow()); insRow.setInserted(); /* * The new row is inserted into the RowSet * immediately following the current row. * * If we are afterlast then the rows are * inserted at the end. */ if (currentRow >= numRows || currentRow < 0) { pos = numRows; } else { pos = currentRow; } rvh.add(pos, insRow); ++numRows; // notify the listeners that the row changed. notifyRowChanged(); } /** * Marks the current row of this <code>CachedRowSetImpl</code> object as * updated and notifies listeners registered with this rowset that the * row has changed. * <P> * This method cannot be called when the cursor is on the insert row, and * it should be called before the cursor moves to another row. If it is * called after the cursor moves to another row, this method has no effect, * and the updates made before the cursor moved will be lost. * * @throws SQLException if the cursor is on the insert row or this * rowset is <code>ResultSet.CONCUR_READ_ONLY</code>Lines 5001–5500 of 10133. Previous lines Load more
* This method updates a column value in 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} * must be called, which will insert the new row into both this rowset * and the database. Both of these methods must be called before the * cursor moves to another row. * * @param columnName a <code>String</code> object that must match the * SQL name of a column in this rowset, ignoring case * @param x the new column value * @throws SQLException if (1) the given column name does not match the * name of a column in this rowset, (2) the cursor is not on * one of this rowset's rows or its insert row, or (3) this * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> */ public void updateShort(String columnName, short x) throws SQLException { updateShort(getColIdxByName(columnName), x); } /** * Sets the designated column in either the current row or the insert * row of this <code>CachedRowSetImpl</code> object with the given * <code>int</code> value. * <P> * This method updates a column value in 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} * must be called, which will insert the new row into both this rowset * and the database. Both of these methods must be called before the * cursor moves to another row. * * @param columnName a <code>String</code> object that must match the * SQL name of a column in this rowset, ignoring case * @param x the new column value * @throws SQLException if (1) the given column name does not match the * name of a column in this rowset, (2) the cursor is not on * one of this rowset's rows or its insert row, or (3) this * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> */ public void updateInt(String columnName, int x) throws SQLException { updateInt(getColIdxByName(columnName), x); } /** * Sets the designated column in either the current row or the insert * row of this <code>CachedRowSetImpl</code> object with the given * <code>long</code> value. * <P> * This method updates a column value in 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} * must be called, which will insert the new row into both this rowset * and the database. Both of these methods must be called before the * cursor moves to another row. * * @param columnName a <code>String</code> object that must match the * SQL name of a column in this rowset, ignoring case * @param x the new column value * @throws SQLException if (1) the given column name does not match the * name of a column in this rowset, (2) the cursor is not on * one of this rowset's rows or its insert row, or (3) this * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> */ public void updateLong(String columnName, long x) throws SQLException { updateLong(getColIdxByName(columnName), x); } /** * Sets the designated column in either the current row or the insert * row of this <code>CachedRowSetImpl</code> object with the given * <code>float</code> value. * <P> * This method updates a column value in 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} * must be called, which will insert the new row into both this rowset * and the database. Both of these methods must be called before the * cursor moves to another row. * * @param columnName a <code>String</code> object that must match the * SQL name of a column in this rowset, ignoring case * @param x the new column value * @throws SQLException if (1) the given column name does not match the * name of a column in this rowset, (2) the cursor is not on * one of this rowset's rows or its insert row, or (3) this * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> */ public void updateFloat(String columnName, float x) throws SQLException { updateFloat(getColIdxByName(columnName), x); } /** * Sets the designated column in either the current row or the insert * row of this <code>CachedRowSetImpl</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} * must be called, which will insert the new row into both this rowset * and the database. Both of these methods must be called before the * cursor moves to another row. * * @param columnName a <code>String</code> object that must match the * SQL name of a column in this rowset, ignoring case * @param x the new column value * @throws SQLException if (1) the given column name does not match the * name of a column in this rowset, (2) the cursor is not on * one of this rowset's rows or its insert row, or (3) this * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> */ public void updateDouble(String columnName, double x) throws SQLException { updateDouble(getColIdxByName(columnName), x); } /** * Sets the designated column in either the current row or the insert * row of this <code>CachedRowSetImpl</code> object with the given * <code>java.math.BigDecimal</code> object. * <P> * This method updates a column value in 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} * must be called, which will insert the new row into both this rowset * and the database. Both of these methods must be called before the * cursor moves to another row. * * @param columnName a <code>String</code> object that must match the * SQL name of a column in this rowset, ignoring case * @param x the new column value * @throws SQLException if (1) the given column name does not match the * name of a column in this rowset, (2) the cursor is not on * one of this rowset's rows or its insert row, or (3) this * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> */ public void updateBigDecimal(String columnName, BigDecimal x) throws SQLException { updateBigDecimal(getColIdxByName(columnName), x); } /** * Sets the designated column in either the current row or the insert * row of this <code>CachedRowSetImpl</code> object with the given * <code>String</code> object. * * 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} * must be called, which will insert the new row into both this rowset * and the database. Both of these methods must be called before the * cursor moves to another row. * * @param columnName a <code>String</code> object that must match the * SQL name of a column in this rowset, ignoring case * @param x the new column value * @throws SQLException if (1) the given column name does not match the * name of a column in this rowset, (2) the cursor is not on * one of this rowset's rows or its insert row, or (3) this * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> */ public void updateString(String columnName, String x) throws SQLException { updateString(getColIdxByName(columnName), x); } /** * Sets the designated column in either the current row or the insert * row of this <code>CachedRowSetImpl</code> object with the given * <code>byte</code> array. * * 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} * must be called, which will insert the new row into both this rowset * and the database. Both of these methods must be called before the * cursor moves to another row. * * @param columnName a <code>String</code> object that must match the * SQL name of a column in this rowset, ignoring case * @param x the new column value * @throws SQLException if (1) the given column name does not match the * name of a column in this rowset, (2) the cursor is not on * one of this rowset's rows or its insert row, or (3) this * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> */ public void updateBytes(String columnName, byte x[]) throws SQLException { updateBytes(getColIdxByName(columnName), x); } /** * Sets the designated column in either the current row or the insert * row of this <code>CachedRowSetImpl</code> object with the given * <code>Date</code> object. * * 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} * must be called, which will insert the new row into both this rowset * and the database. Both of these methods must be called before the * cursor moves to another row. * * @param columnName a <code>String</code> object that must match the * SQL name of a column in this rowset, ignoring case * @param x the new column value * @throws SQLException if (1) the given column name does not match the * name of a column in this rowset, (2) the cursor is not on * one of this rowset's rows or its insert row, (3) the type * of the designated column is not an SQL <code>DATE</code> or * <code>TIMESTAMP</code>, or (4) this rowset is * <code>ResultSet.CONCUR_READ_ONLY</code> */ public void updateDate(String columnName, java.sql.Date x) throws SQLException { updateDate(getColIdxByName(columnName), x); } /** * Sets the designated column in either the current row or the insert * row of this <code>CachedRowSetImpl</code> object with the given * <code>Time</code> object. * * 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} * must be called, which will insert the new row into both this rowset * and the database. Both of these methods must be called before the * cursor moves to another row. * * @param columnName a <code>String</code> object that must match the * SQL name of a column in this rowset, ignoring case * @param x the new column value * @throws SQLException if (1) the given column name does not match the * name of a column in this rowset, (2) the cursor is not on * one of this rowset's rows or its insert row, (3) the type * of the designated column is not an SQL <code>TIME</code> or * <code>TIMESTAMP</code>, or (4) this rowset is * <code>ResultSet.CONCUR_READ_ONLY</code> */ public void updateTime(String columnName, java.sql.Time x) throws SQLException { updateTime(getColIdxByName(columnName), x); } /** * Sets the designated column in either the current row or the insert * row of this <code>CachedRowSetImpl</code> object with the given * <code>Timestamp</code> object. * * 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} * must be called, which will insert the new row into both this rowset * and the database. Both of these methods must be called before the * cursor moves to another row. * * @param columnName a <code>String</code> object that must match the * SQL name of a column in this rowset, ignoring case * @param x the new column value * @throws SQLException if the given column index is out of bounds or * the cursor is not on one of this rowset's rows or its * insert row * @throws SQLException if (1) the given column name does not match the * name of a column in this rowset, (2) the cursor is not on * one of this rowset's rows or its insert row, (3) the type * of the designated column is not an SQL <code>DATE</code>, * <code>TIME</code>, or <code>TIMESTAMP</code>, or (4) this * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> */ public void updateTimestamp(String columnName, java.sql.Timestamp x) throws SQLException { updateTimestamp(getColIdxByName(columnName), x); } /** * Sets the designated column in either the current row or the insert * row of this <code>CachedRowSetImpl</code> object with the given * ASCII stream value. * <P> * 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} * must be called, which will insert the new row into both this rowset * and the database. Both of these methods must be called before the * cursor moves to another row. * * @param columnName a <code>String</code> object that must match the * SQL name of a column in this rowset, ignoring case * @param x the new column value * @param length the number of one-byte ASCII characters in the stream */ public void updateAsciiStream(String columnName, java.io.InputStream x, int length) throws SQLException { updateAsciiStream(getColIdxByName(columnName), x, length); } /** * Sets the designated column in either the current row or the insert * row of this <code>CachedRowSetImpl</code> object with the given * <code>java.io.InputStream</code> object. * <P> * 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} * must be called, which will insert the new row into both this rowset * and the database. Both of these methods must be called before the * cursor moves to another row. * * @param columnName a <code>String</code> object that must match the * SQL name of a column in this rowset, ignoring case * @param x the new column value; must be a <code>java.io.InputStream</code> * containing <code>BINARY</code>, <code>VARBINARY</code>, or * <code>LONGVARBINARY</code> data * @param length the length of the stream in bytes * @throws SQLException if (1) the given column name does not match the * name of a column in this rowset, (2) the cursor is not on * one of this rowset's rows or its insert row, (3) the data * in the stream is not binary, or (4) this rowset is * <code>ResultSet.CONCUR_READ_ONLY</code> */ public void updateBinaryStream(String columnName, java.io.InputStream x, int length) throws SQLException { updateBinaryStream(getColIdxByName(columnName), x, length); } /** * Sets the designated column in either the current row or the insert * row of this <code>CachedRowSetImpl</code> object with the given * <code>java.io.Reader</code> object. * <P> * 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} * must be called, which will insert the new row into both this rowset * and the database. Both of these methods must be called before the * cursor moves to another row. * * @param columnName a <code>String</code> object that must match the * SQL name of a column in this rowset, ignoring case * @param reader the new column value; must be a * <code>java.io.Reader</code> containing <code>BINARY</code>, * <code>VARBINARY</code>, <code>LONGVARBINARY</code>, <code>CHAR</code>, * <code>VARCHAR</code>, or <code>LONGVARCHAR</code> data * @param length the length of the stream in characters * @throws SQLException if (1) the given column name does not match the * name of a column in this rowset, (2) the cursor is not on * one of this rowset's rows or its insert row, (3) the data * in the stream is not a binary or character type, or (4) this * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> */ public void updateCharacterStream(String columnName, java.io.Reader reader, int length) throws SQLException { updateCharacterStream(getColIdxByName(columnName), reader, length); } /** * Sets the designated column in either the current row or the insert * row of this <code>CachedRowSetImpl</code> object with the given * <code>Object</code> value. The <code>scale</code> parameter * indicates the number of digits to the right of the decimal point * and is ignored if the new column value is not a type that will be * mapped to an SQL <code>DECIMAL</code> or <code>NUMERIC</code> value. * <P> * 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} * must be called, which will insert the new row into both this rowset * and the database. Both of these methods must be called before the * cursor moves to another row. * * @param columnName a <code>String</code> object that must match the * SQL name of a column in this rowset, ignoring case * @param x the new column value * @param scale the number of digits to the right of the decimal point (for * <code>DECIMAL</code> and <code>NUMERIC</code> types only) * @throws SQLException if (1) the given column name does not match the * name of a column in this rowset, (2) the cursor is not on * one of this rowset's rows or its insert row, or (3) this * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> */ public void updateObject(String columnName, Object x, int scale) throws SQLException { updateObject(getColIdxByName(columnName), x, scale); } /** * Sets the designated column in either the current row or the insert * row of this <code>CachedRowSetImpl</code> object with the given * <code>Object</code> value. * <P> * 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} * must be called, which will insert the new row into both this rowset * and the database. Both of these methods must be called before the * cursor moves to another row. * * @param columnName a <code>String</code> object that must match the * SQL name of a column in this rowset, ignoring case * @param x the new column value * @throws SQLException if (1) the given column name does not match the * name of a column in this rowset, (2) the cursor is not on * one of this rowset's rows or its insert row, or (3) this * rowset is <code>ResultSet.CONCUR_READ_ONLY</code> */ public void updateObject(String columnName, Object x) throws SQLException { updateObject(getColIdxByName(columnName), x); } /** * Inserts the contents of this <code>CachedRowSetImpl</code> object's insert * row into this rowset immediately following the current row. * If the current row is the * position after the last row or before the first row, the new row will * be inserted at the end of the rowset. This method also notifies * listeners registered with this rowset that the row has changed. * <P> * The cursor must be on the insert row when this method is called. * * @throws SQLException if (1) the cursor is not on the insert row, * (2) one or more of the non-nullable columns in the insert * row has not been given a value, or (3) this rowset is * <code>ResultSet.CONCUR_READ_ONLY</code> */ public void insertRow() throws SQLException { int pos; if (onInsertRow == false || insertRow.isCompleteRow(RowSetMD) == false) { throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.failedins").toString()); } // Added the setting of parameters that are passed // to setXXX methods after an empty CRS Object is // created through RowSetMetaData object Object [] toInsert = getParams(); for(int i = 0;i < toInsert.length; i++) { insertRow.setColumnObject(i+1,toInsert[i]); } Row insRow = new Row(RowSetMD.getColumnCount(), insertRow.getOrigRow()); insRow.setInserted(); /* * The new row is inserted into the RowSet * immediately following the current row. * * If we are afterlast then the rows are * inserted at the end. */ if (currentRow >= numRows || currentRow < 0) { pos = numRows; } else { pos = currentRow; } rvh.add(pos, insRow); ++numRows; // notify the listeners that the row changed. notifyRowChanged(); } /** * Marks the current row of this <code>CachedRowSetImpl</code> object as * updated and notifies listeners registered with this rowset that the * row has changed. * <P> * This method cannot be called when the cursor is on the insert row, and * it should be called before the cursor moves to another row. If it is * called after the cursor moves to another row, this method has no effect, * and the updates made before the cursor moved will be lost. * * @throws SQLException if the cursor is on the insert row or this * rowset is <code>ResultSet.CONCUR_READ_ONLY</code>