Class UpdatableResultSet

java.lang.Object
com.mysql.jdbc.ResultSetImpl
com.mysql.jdbc.UpdatableResultSet
All Implemented Interfaces:
ResultSetInternalMethods, AutoCloseable, ResultSet, Wrapper
Direct Known Subclasses:
JDBC4UpdatableResultSet

public class UpdatableResultSet extends ResultSetImpl
A result set that is updatable.
  • Field Details

    • STREAM_DATA_MARKER

      static final byte[] STREAM_DATA_MARKER
      Marker for 'stream' data when doing INSERT rows
    • charConverter

      protected SingleByteCharsetConverter charConverter
    • inserter

      protected PreparedStatement inserter
      PreparedStatement used to insert data
    • updater

      protected PreparedStatement updater
      PreparedStatement used to delete data
  • Constructor Details

    • UpdatableResultSet

      protected UpdatableResultSet(String catalog, Field[] fields, RowData tuples, MySQLConnection conn, StatementImpl creatorStmt) throws SQLException
      Creates a new ResultSet object.
      Parameters:
      catalog - the database in use when we were created
      fields - an array of Field objects (basically, the ResultSet MetaData)
      tuples - actual row data
      conn - the Connection that created us.
      creatorStmt -
      Throws:
      SQLException
  • Method Details

    • absolute

      public boolean absolute(int row) throws SQLException
      JDBC 2.0

      Move to an absolute row number in the result set.

      If row is positive, moves to an absolute row with respect to the beginning of the result set. The first row is row 1, the second is row 2, etc.

      If row is negative, moves to an absolute row position with respect to the end of result set. For example, calling absolute(-1) positions the cursor on the last row, absolute(-2) indicates the next-to-last row, etc.

      An attempt to position the cursor beyond the first/last row in the result set, leaves the cursor before/after the first/last row, respectively.

      Note: Calling absolute(1) is the same as calling first(). Calling absolute(-1) is the same as calling last().

      Specified by:
      absolute in interface ResultSet
      Overrides:
      absolute in class ResultSetImpl
      Parameters:
      row -
      Returns:
      true if on the result set, false if off.
      Throws:
      SQLException - if a database-access error occurs, or row is 0, or result set type is TYPE_FORWARD_ONLY.
    • afterLast

      public void afterLast() throws SQLException
      JDBC 2.0

      Moves to the end of the result set, just after the last row. Has no effect if the result set contains no rows.

      Specified by:
      afterLast in interface ResultSet
      Overrides:
      afterLast in class ResultSetImpl
      Throws:
      SQLException - if a database-access error occurs, or result set type is TYPE_FORWARD_ONLY.
    • beforeFirst

      public void beforeFirst() throws SQLException
      JDBC 2.0

      Moves to the front of the result set, just before the first row. Has no effect if the result set contains no rows.

      Specified by:
      beforeFirst in interface ResultSet
      Overrides:
      beforeFirst in class ResultSetImpl
      Throws:
      SQLException - if a database-access error occurs, or result set type is TYPE_FORWARD_ONLY
    • cancelRowUpdates

      public void cancelRowUpdates() throws SQLException
      JDBC 2.0 The cancelRowUpdates() method may be called after calling an updateXXX() method(s) and before calling updateRow() to rollback the updates made to a row. If no updates have been made or updateRow() has already been called, then this method has no effect.
      Specified by:
      cancelRowUpdates in interface ResultSet
      Overrides:
      cancelRowUpdates in class ResultSetImpl
      Throws:
      SQLException - if a database-access error occurs, or if called when on the insert row.
    • checkRowPos

      protected void checkRowPos() throws SQLException
      Description copied from class: ResultSetImpl
      Ensures that the cursor is positioned on a valid row and that the result set is not closed
      Overrides:
      checkRowPos in class ResultSetImpl
      Throws:
      SQLException - if the result set is not in a valid state for traversal
    • checkUpdatability

      protected void checkUpdatability() throws SQLException
      Is this ResultSet updateable?
      Throws:
      SQLException
    • deleteRow

      public void deleteRow() throws SQLException
      JDBC 2.0 Delete the current row from the result set and the underlying database. Cannot be called when on the insert row.
      Specified by:
      deleteRow in interface ResultSet
      Overrides:
      deleteRow in class ResultSetImpl
      Throws:
      SQLException - if a database-access error occurs, or if called when on the insert row.
      SQLException - if the ResultSet is not updatable or some other error occurs
    • first

      public boolean first() throws SQLException
      JDBC 2.0

      Moves to the first row in the result set.

      Specified by:
      first in interface ResultSet
      Overrides:
      first in class ResultSetImpl
      Returns:
      true if on a valid row, false if no rows in the result set.
      Throws:
      SQLException - if a database-access error occurs, or result set type is TYPE_FORWARD_ONLY.
    • generateStatements

      protected void generateStatements() throws SQLException
      Figure out whether or not this ResultSet is updateable, and if so, generate the PreparedStatements to support updates.
      Throws:
      SQLException
      NotUpdatable
    • getConcurrency

      public int getConcurrency() throws SQLException
      JDBC 2.0 Return the concurrency of this result set. The concurrency used is determined by the statement that created the result set.
      Specified by:
      getConcurrency in interface ResultSet
      Overrides:
      getConcurrency in class ResultSetImpl
      Returns:
      the concurrency type, CONCUR_READ_ONLY, etc.
      Throws:
      SQLException - if a database-access error occurs
    • insertRow

      public void insertRow() throws SQLException
      JDBC 2.0 Insert the contents of the insert row into the result set and the database. Must be on the insert row when this method is called.
      Specified by:
      insertRow in interface ResultSet
      Overrides:
      insertRow in class ResultSetImpl
      Throws:
      SQLException - if a database-access error occurs, if called when not on the insert row, or if all non-nullable columns in the insert row have not been given a value
    • isAfterLast

      public boolean isAfterLast() throws SQLException
      JDBC 2.0

      Determine if the cursor is after the last row in the result set.

      Specified by:
      isAfterLast in interface ResultSet
      Overrides:
      isAfterLast in class ResultSetImpl
      Returns:
      true if after the last row, false otherwise. Returns false when the result set contains no rows.
      Throws:
      SQLException - if a database-access error occurs.
    • isBeforeFirst

      public boolean isBeforeFirst() throws SQLException
      JDBC 2.0

      Determine if the cursor is before the first row in the result set.

      Specified by:
      isBeforeFirst in interface ResultSet
      Overrides:
      isBeforeFirst in class ResultSetImpl
      Returns:
      true if before the first row, false otherwise. Returns false when the result set contains no rows.
      Throws:
      SQLException - if a database-access error occurs.
    • isFirst

      public boolean isFirst() throws SQLException
      JDBC 2.0

      Determine if the cursor is on the first row of the result set.

      Specified by:
      isFirst in interface ResultSet
      Overrides:
      isFirst in class ResultSetImpl
      Returns:
      true if on the first row, false otherwise.
      Throws:
      SQLException - if a database-access error occurs.
    • isLast

      public boolean isLast() throws SQLException
      JDBC 2.0

      Determine if the cursor is on the last row of the result set. Note: Calling isLast() may be expensive since the JDBC driver might need to fetch ahead one row in order to determine whether the current row is the last row in the result set.

      Specified by:
      isLast in interface ResultSet
      Overrides:
      isLast in class ResultSetImpl
      Returns:
      true if on the last row, false otherwise.
      Throws:
      SQLException - if a database-access error occurs.
    • isUpdatable

      boolean isUpdatable()
    • last

      public boolean last() throws SQLException
      JDBC 2.0

      Moves to the last row in the result set.

      Specified by:
      last in interface ResultSet
      Overrides:
      last in class ResultSetImpl
      Returns:
      true if on a valid row, false if no rows in the result set.
      Throws:
      SQLException - if a database-access error occurs, or result set type is TYPE_FORWARD_ONLY.
    • moveToCurrentRow

      public void moveToCurrentRow() throws SQLException
      JDBC 2.0 Move the cursor to the remembered cursor position, usually the current row. Has no effect unless the cursor is on the insert row.
      Specified by:
      moveToCurrentRow in interface ResultSet
      Overrides:
      moveToCurrentRow in class ResultSetImpl
      Throws:
      SQLException - if a database-access error occurs, or the result set is not updatable
      SQLException - if the ResultSet is not updatable or some other error occurs
    • moveToInsertRow

      public void moveToInsertRow() throws SQLException
      JDBC 2.0 Move 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 updateXXX() methods prior to inserting the row into the result set. Only the updateXXX(), getXXX(), and insertRow() 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 insertRow(). UpdateXXX()must be called before getXXX() on a column.
      Specified by:
      moveToInsertRow in interface ResultSet
      Overrides:
      moveToInsertRow in class ResultSetImpl
      Throws:
      SQLException - if a database-access error occurs, or the result set is not updatable
      NotUpdatable
    • next

      public boolean next() throws SQLException
      A ResultSet is initially positioned before its first row, the first call to next makes the first row the current row; the second call makes the second row the current row, etc.

      If an input stream from the previous row is open, it is implicitly closed. The ResultSet's warning chain is cleared when a new row is read

      Specified by:
      next in interface ResultSet
      Overrides:
      next in class ResultSetImpl
      Returns:
      true if the new current is valid; false if there are no more rows
      Throws:
      SQLException - if a database access error occurs
    • prev

      public boolean prev() throws SQLException
      The prev method is not part of JDBC, but because of the architecture of this driver it is possible to move both forward and backward within the result set.

      If an input stream from the previous row is open, it is implicitly closed. The ResultSet's warning chain is cleared when a new row is read

      Overrides:
      prev in class ResultSetImpl
      Returns:
      true if the new current is valid; false if there are no more rows
      Throws:
      SQLException - if a database access error occurs
    • previous

      public boolean previous() throws SQLException
      JDBC 2.0

      Moves to the previous row in the result set.

      Note: previous() is not the same as relative(-1) since it makes sense to call previous() when there is no current row.

      Specified by:
      previous in interface ResultSet
      Overrides:
      previous in class ResultSetImpl
      Returns:
      true if on a valid row, false if off the result set.
      Throws:
      SQLException - if a database-access error occurs, or result set type is TYPE_FORWAR_DONLY.
    • realClose

      public void realClose(boolean calledExplicitly) throws SQLException
      Closes this ResultSet and releases resources.
      Specified by:
      realClose in interface ResultSetInternalMethods
      Overrides:
      realClose in class ResultSetImpl
      Parameters:
      calledExplicitly - was realClose called by the standard ResultSet.close() method, or was it closed internally by the driver?
      Throws:
      SQLException - if an error occurs.
    • refreshRow

      public void refreshRow() throws SQLException
      JDBC 2.0 Refresh the value of the current row with its current value in the database. Cannot be called when on the insert row. The refreshRow() 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 refreshRow() 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. All values are refetched subject to the transaction isolation level and cursor sensitivity. If refreshRow() is called after calling updateXXX(), but before calling updateRow() then the updates made to the row are lost. Calling refreshRow() frequently will likely slow performance.
      Specified by:
      refreshRow in interface ResultSet
      Overrides:
      refreshRow in class ResultSetImpl
      Throws:
      SQLException - if a database-access error occurs, or if called when on the insert row.
      NotUpdatable
    • relative

      public boolean relative(int rows) throws SQLException
      JDBC 2.0

      Moves a relative number of rows, either positive or negative. Attempting to move beyond the first/last row in the result set positions the cursor before/after the the first/last row. Calling relative(0) is valid, but does not change the cursor position.

      Note: Calling relative(1) is different than calling next() since is makes sense to call next() when there is no current row, for example, when the cursor is positioned before the first row or after the last row of the result set.

      Specified by:
      relative in interface ResultSet
      Overrides:
      relative in class ResultSetImpl
      Parameters:
      rows -
      Returns:
      true if on a row, false otherwise.
      Throws:
      SQLException - if a database-access error occurs, or there is no current row, or result set type is TYPE_FORWARD_ONLY.
    • rowDeleted

      public boolean rowDeleted() throws SQLException
      JDBC 2.0 Determine if this row has been deleted. A deleted row may leave a visible "hole" in a result set. This method can be used to detect holes in a result set. The value returned depends on whether or not the result set can detect deletions.
      Specified by:
      rowDeleted in interface ResultSet
      Overrides:
      rowDeleted in class ResultSetImpl
      Returns:
      true if deleted and deletes are detected
      Throws:
      SQLException - if a database-access error occurs
      NotImplemented
      See Also:
    • rowInserted

      public boolean rowInserted() throws SQLException
      JDBC 2.0 Determine if the current row has been inserted. The value returned depends on whether or not the result set can detect visible inserts.
      Specified by:
      rowInserted in interface ResultSet
      Overrides:
      rowInserted in class ResultSetImpl
      Returns:
      true if inserted and inserts are detected
      Throws:
      SQLException - if a database-access error occurs
      NotImplemented
      See Also:
    • rowUpdated

      public boolean rowUpdated() throws SQLException
      JDBC 2.0 Determine if the current row has been updated. The value returned depends on whether or not the result set can detect updates.
      Specified by:
      rowUpdated in interface ResultSet
      Overrides:
      rowUpdated in class ResultSetImpl
      Returns:
      true if the row has been visibly updated by the owner or another, and updates are detected
      Throws:
      SQLException - if a database-access error occurs
      NotImplemented
      See Also:
    • setResultSetConcurrency

      protected void setResultSetConcurrency(int concurrencyFlag)
      Sets the concurrency type of this result set
      Overrides:
      setResultSetConcurrency in class ResultSetImpl
      Parameters:
      concurrencyFlag - the type of concurrency that this ResultSet should support.
    • syncUpdate

      protected void syncUpdate() throws SQLException
      Reset UPDATE prepared statement to value in current row. This_Row MUST point to current, valid row.
      Throws:
      SQLException
    • updateAsciiStream

      public void updateAsciiStream(int columnIndex, InputStream x, int length) throws SQLException
      JDBC 2.0 Update a column with an ascii stream value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.
      Specified by:
      updateAsciiStream in interface ResultSet
      Overrides:
      updateAsciiStream in class ResultSetImpl
      Parameters:
      columnIndex - the first column is 1, the second is 2, ...
      x - the new column value
      length - the length of the stream
      Throws:
      SQLException - if a database-access error occurs
    • updateAsciiStream

      public void updateAsciiStream(String columnName, InputStream x, int length) throws SQLException
      JDBC 2.0 Update a column with an ascii stream value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.
      Specified by:
      updateAsciiStream in interface ResultSet
      Overrides:
      updateAsciiStream in class ResultSetImpl
      Parameters:
      columnName - the name of the column
      x - the new column value
      length - of the stream
      Throws:
      SQLException - if a database-access error occurs
    • updateBigDecimal

      public void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException
      JDBC 2.0 Update a column with a BigDecimal value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.
      Specified by:
      updateBigDecimal in interface ResultSet
      Overrides:
      updateBigDecimal in class ResultSetImpl
      Parameters:
      columnIndex - the first column is 1, the second is 2, ...
      x - the new column value
      Throws:
      SQLException - if a database-access error occurs
    • updateBigDecimal

      public void updateBigDecimal(String columnName, BigDecimal x) throws SQLException
      JDBC 2.0 Update a column with a BigDecimal value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.
      Specified by:
      updateBigDecimal in interface ResultSet
      Overrides:
      updateBigDecimal in class ResultSetImpl
      Parameters:
      columnName - the name of the column
      x - the new column value
      Throws:
      SQLException - if a database-access error occurs
    • updateBinaryStream

      public void updateBinaryStream(int columnIndex, InputStream x, int length) throws SQLException
      JDBC 2.0 Update a column with a binary stream value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.
      Specified by:
      updateBinaryStream in interface ResultSet
      Overrides:
      updateBinaryStream in class ResultSetImpl
      Parameters:
      columnIndex - the first column is 1, the second is 2, ...
      x - the new column value
      length - the length of the stream
      Throws:
      SQLException - if a database-access error occurs
    • updateBinaryStream

      public void updateBinaryStream(String columnName, InputStream x, int length) throws SQLException
      JDBC 2.0 Update a column with a binary stream value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.
      Specified by:
      updateBinaryStream in interface ResultSet
      Overrides:
      updateBinaryStream in class ResultSetImpl
      Parameters:
      columnName - the name of the column
      x - the new column value
      length - of the stream
      Throws:
      SQLException - if a database-access error occurs
    • updateBlob

      public void updateBlob(int columnIndex, Blob blob) throws SQLException
      Specified by:
      updateBlob in interface ResultSet
      Overrides:
      updateBlob in class ResultSetImpl
      Throws:
      SQLException
      See Also:
    • updateBlob

      public void updateBlob(String columnName, Blob blob) throws SQLException
      Specified by:
      updateBlob in interface ResultSet
      Overrides:
      updateBlob in class ResultSetImpl
      Throws:
      SQLException
      See Also:
    • updateBoolean

      public void updateBoolean(int columnIndex, boolean x) throws SQLException
      JDBC 2.0 Update a column with a boolean value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.
      Specified by:
      updateBoolean in interface ResultSet
      Overrides:
      updateBoolean in class ResultSetImpl
      Parameters:
      columnIndex - the first column is 1, the second is 2, ...
      x - the new column value
      Throws:
      SQLException - if a database-access error occurs
    • updateBoolean

      public void updateBoolean(String columnName, boolean x) throws SQLException
      JDBC 2.0 Update a column with a boolean value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.
      Specified by:
      updateBoolean in interface ResultSet
      Overrides:
      updateBoolean in class ResultSetImpl
      Parameters:
      columnName - the name of the column
      x - the new column value
      Throws:
      SQLException - if a database-access error occurs
    • updateByte

      public void updateByte(int columnIndex, byte x) throws SQLException
      JDBC 2.0 Update a column with a byte value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.
      Specified by:
      updateByte in interface ResultSet
      Overrides:
      updateByte in class ResultSetImpl
      Parameters:
      columnIndex - the first column is 1, the second is 2, ...
      x - the new column value
      Throws:
      SQLException - if a database-access error occurs
    • updateByte

      public void updateByte(String columnName, byte x) throws SQLException
      JDBC 2.0 Update a column with a byte value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.
      Specified by:
      updateByte in interface ResultSet
      Overrides:
      updateByte in class ResultSetImpl
      Parameters:
      columnName - the name of the column
      x - the new column value
      Throws:
      SQLException - if a database-access error occurs
    • updateBytes

      public void updateBytes(int columnIndex, byte[] x) throws SQLException
      JDBC 2.0 Update a column with a byte array value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.
      Specified by:
      updateBytes in interface ResultSet
      Overrides:
      updateBytes in class ResultSetImpl
      Parameters:
      columnIndex - the first column is 1, the second is 2, ...
      x - the new column value
      Throws:
      SQLException - if a database-access error occurs
    • updateBytes

      public void updateBytes(String columnName, byte[] x) throws SQLException
      JDBC 2.0 Update a column with a byte array value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.
      Specified by:
      updateBytes in interface ResultSet
      Overrides:
      updateBytes in class ResultSetImpl
      Parameters:
      columnName - the name of the column
      x - the new column value
      Throws:
      SQLException - if a database-access error occurs
    • updateCharacterStream

      public void updateCharacterStream(int columnIndex, Reader x, int length) throws SQLException
      JDBC 2.0 Update a column with a character stream value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.
      Specified by:
      updateCharacterStream in interface ResultSet
      Overrides:
      updateCharacterStream in class ResultSetImpl
      Parameters:
      columnIndex - the first column is 1, the second is 2, ...
      x - the new column value
      length - the length of the stream
      Throws:
      SQLException - if a database-access error occurs
    • updateCharacterStream

      public void updateCharacterStream(String columnName, Reader reader, int length) throws SQLException
      JDBC 2.0 Update a column with a character stream value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.
      Specified by:
      updateCharacterStream in interface ResultSet
      Overrides:
      updateCharacterStream in class ResultSetImpl
      Parameters:
      columnName - the name of the column
      reader - the new column value
      length - of the stream
      Throws:
      SQLException - if a database-access error occurs
    • updateClob

      public void updateClob(int columnIndex, Clob clob) throws SQLException
      Specified by:
      updateClob in interface ResultSet
      Overrides:
      updateClob in class ResultSetImpl
      Throws:
      SQLException
      See Also:
    • updateDate

      public void updateDate(int columnIndex, Date x) throws SQLException
      JDBC 2.0 Update a column with a Date value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.
      Specified by:
      updateDate in interface ResultSet
      Overrides:
      updateDate in class ResultSetImpl
      Parameters:
      columnIndex - the first column is 1, the second is 2, ...
      x - the new column value
      Throws:
      SQLException - if a database-access error occurs
    • updateDate

      public void updateDate(String columnName, Date x) throws SQLException
      JDBC 2.0 Update a column with a Date value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.
      Specified by:
      updateDate in interface ResultSet
      Overrides:
      updateDate in class ResultSetImpl
      Parameters:
      columnName - the name of the column
      x - the new column value
      Throws:
      SQLException - if a database-access error occurs
    • updateDouble

      public void updateDouble(int columnIndex, double x) throws SQLException
      JDBC 2.0 Update a column with a Double value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.
      Specified by:
      updateDouble in interface ResultSet
      Overrides:
      updateDouble in class ResultSetImpl
      Parameters:
      columnIndex - the first column is 1, the second is 2, ...
      x - the new column value
      Throws:
      SQLException - if a database-access error occurs
    • updateDouble

      public void updateDouble(String columnName, double x) throws SQLException
      JDBC 2.0 Update a column with a double value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.
      Specified by:
      updateDouble in interface ResultSet
      Overrides:
      updateDouble in class ResultSetImpl
      Parameters:
      columnName - the name of the column
      x - the new column value
      Throws:
      SQLException - if a database-access error occurs
    • updateFloat

      public void updateFloat(int columnIndex, float x) throws SQLException
      JDBC 2.0 Update a column with a float value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.
      Specified by:
      updateFloat in interface ResultSet
      Overrides:
      updateFloat in class ResultSetImpl
      Parameters:
      columnIndex - the first column is 1, the second is 2, ...
      x - the new column value
      Throws:
      SQLException - if a database-access error occurs
    • updateFloat

      public void updateFloat(String columnName, float x) throws SQLException
      JDBC 2.0 Update a column with a float value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.
      Specified by:
      updateFloat in interface ResultSet
      Overrides:
      updateFloat in class ResultSetImpl
      Parameters:
      columnName - the name of the column
      x - the new column value
      Throws:
      SQLException - if a database-access error occurs
    • updateInt

      public void updateInt(int columnIndex, int x) throws SQLException
      JDBC 2.0 Update a column with an integer value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.
      Specified by:
      updateInt in interface ResultSet
      Overrides:
      updateInt in class ResultSetImpl
      Parameters:
      columnIndex - the first column is 1, the second is 2, ...
      x - the new column value
      Throws:
      SQLException - if a database-access error occurs
    • updateInt

      public void updateInt(String columnName, int x) throws SQLException
      JDBC 2.0 Update a column with an integer value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.
      Specified by:
      updateInt in interface ResultSet
      Overrides:
      updateInt in class ResultSetImpl
      Parameters:
      columnName - the name of the column
      x - the new column value
      Throws:
      SQLException - if a database-access error occurs
    • updateLong

      public void updateLong(int columnIndex, long x) throws SQLException
      JDBC 2.0 Update a column with a long value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.
      Specified by:
      updateLong in interface ResultSet
      Overrides:
      updateLong in class ResultSetImpl
      Parameters:
      columnIndex - the first column is 1, the second is 2, ...
      x - the new column value
      Throws:
      SQLException - if a database-access error occurs
    • updateLong

      public void updateLong(String columnName, long x) throws SQLException
      JDBC 2.0 Update a column with a long value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.
      Specified by:
      updateLong in interface ResultSet
      Overrides:
      updateLong in class ResultSetImpl
      Parameters:
      columnName - the name of the column
      x - the new column value
      Throws:
      SQLException - if a database-access error occurs
    • updateNull

      public void updateNull(int columnIndex) throws SQLException
      JDBC 2.0 Give a nullable column a null value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.
      Specified by:
      updateNull in interface ResultSet
      Overrides:
      updateNull in class ResultSetImpl
      Parameters:
      columnIndex - the first column is 1, the second is 2, ...
      Throws:
      SQLException - if a database-access error occurs
    • updateNull

      public void updateNull(String columnName) throws SQLException
      JDBC 2.0 Update a column with a null value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.
      Specified by:
      updateNull in interface ResultSet
      Overrides:
      updateNull in class ResultSetImpl
      Parameters:
      columnName - the name of the column
      Throws:
      SQLException - if a database-access error occurs
    • updateObject

      public void updateObject(int columnIndex, Object x) throws SQLException
      JDBC 2.0 Update a column with an Object value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.
      Specified by:
      updateObject in interface ResultSet
      Overrides:
      updateObject in class ResultSetImpl
      Parameters:
      columnIndex - the first column is 1, the second is 2, ...
      x - the new column value
      Throws:
      SQLException - if a database-access error occurs
    • updateObject

      public void updateObject(int columnIndex, Object x, int scale) throws SQLException
      JDBC 2.0 Update a column with an Object value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.
      Specified by:
      updateObject in interface ResultSet
      Overrides:
      updateObject in class ResultSetImpl
      Parameters:
      columnIndex - the first column is 1, the second is 2, ...
      x - the new column value
      scale - For java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types this is the number of digits after the decimal. For all other types this value will be ignored.
      Throws:
      SQLException - if a database-access error occurs
    • updateObjectInternal

      protected void updateObjectInternal(int columnIndex, Object x, Integer targetType, int scaleOrLength) throws SQLException
      Internal setObject implementation. Although targetType is not part of default ResultSet methods signatures, it is used for type conversions from JDBC42UpdatableResultSet new JDBC 4.2 updateObject() methods.
      Parameters:
      columnIndex -
      x -
      targetType -
      scaleOrLength -
      Throws:
      SQLException
    • updateObject

      public void updateObject(String columnName, Object x) throws SQLException
      JDBC 2.0 Update a column with an Object value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.
      Specified by:
      updateObject in interface ResultSet
      Overrides:
      updateObject in class ResultSetImpl
      Parameters:
      columnName - the name of the column
      x - the new column value
      Throws:
      SQLException - if a database-access error occurs
    • updateObject

      public void updateObject(String columnName, Object x, int scale) throws SQLException
      JDBC 2.0 Update a column with an Object value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.
      Specified by:
      updateObject in interface ResultSet
      Overrides:
      updateObject in class ResultSetImpl
      Parameters:
      columnName - the name of the column
      x - the new column value
      scale - For java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types this is the number of digits after the decimal. For all other types this value will be ignored.
      Throws:
      SQLException - if a database-access error occurs
    • updateRow

      public void updateRow() throws SQLException
      JDBC 2.0 Update the underlying database with the new contents of the current row. Cannot be called when on the insert row.
      Specified by:
      updateRow in interface ResultSet
      Overrides:
      updateRow in class ResultSetImpl
      Throws:
      SQLException - if a database-access error occurs, or if called when on the insert row
      NotUpdatable
    • updateShort

      public void updateShort(int columnIndex, short x) throws SQLException
      JDBC 2.0 Update a column with a short value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.
      Specified by:
      updateShort in interface ResultSet
      Overrides:
      updateShort in class ResultSetImpl
      Parameters:
      columnIndex - the first column is 1, the second is 2, ...
      x - the new column value
      Throws:
      SQLException - if a database-access error occurs
    • updateShort

      public void updateShort(String columnName, short x) throws SQLException
      JDBC 2.0 Update a column with a short value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.
      Specified by:
      updateShort in interface ResultSet
      Overrides:
      updateShort in class ResultSetImpl
      Parameters:
      columnName - the name of the column
      x - the new column value
      Throws:
      SQLException - if a database-access error occurs
    • updateString

      public void updateString(int columnIndex, String x) throws SQLException
      JDBC 2.0 Update a column with a String value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.
      Specified by:
      updateString in interface ResultSet
      Overrides:
      updateString in class ResultSetImpl
      Parameters:
      columnIndex - the first column is 1, the second is 2, ...
      x - the new column value
      Throws:
      SQLException - if a database-access error occurs
    • updateString

      public void updateString(String columnName, String x) throws SQLException
      JDBC 2.0 Update a column with a String value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.
      Specified by:
      updateString in interface ResultSet
      Overrides:
      updateString in class ResultSetImpl
      Parameters:
      columnName - the name of the column
      x - the new column value
      Throws:
      SQLException - if a database-access error occurs
    • updateTime

      public void updateTime(int columnIndex, Time x) throws SQLException
      JDBC 2.0 Update a column with a Time value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.
      Specified by:
      updateTime in interface ResultSet
      Overrides:
      updateTime in class ResultSetImpl
      Parameters:
      columnIndex - the first column is 1, the second is 2, ...
      x - the new column value
      Throws:
      SQLException - if a database-access error occurs
    • updateTime

      public void updateTime(String columnName, Time x) throws SQLException
      JDBC 2.0 Update a column with a Time value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.
      Specified by:
      updateTime in interface ResultSet
      Overrides:
      updateTime in class ResultSetImpl
      Parameters:
      columnName - the name of the column
      x - the new column value
      Throws:
      SQLException - if a database-access error occurs
    • updateTimestamp

      public void updateTimestamp(int columnIndex, Timestamp x) throws SQLException
      JDBC 2.0 Update a column with a Timestamp value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.
      Specified by:
      updateTimestamp in interface ResultSet
      Overrides:
      updateTimestamp in class ResultSetImpl
      Parameters:
      columnIndex - the first column is 1, the second is 2, ...
      x - the new column value
      Throws:
      SQLException - if a database-access error occurs
    • updateTimestamp

      public void updateTimestamp(String columnName, Timestamp x) throws SQLException
      JDBC 2.0 Update a column with a Timestamp value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.
      Specified by:
      updateTimestamp in interface ResultSet
      Overrides:
      updateTimestamp in class ResultSetImpl
      Parameters:
      columnName - the name of the column
      x - the new column value
      Throws:
      SQLException - if a database-access error occurs