Android
java.sql
public interface

java.sql.ResultSet

java.sql.ResultSet

An interface to an Object which represents a Table of Data, typically returned as the result of a Query to a Database.

ResultSets have a Cursor which points to a current row of data. When a ResultSet is created, the Cursor is positioned before the first row. To move the Cursor to the next row in the table, use the next method. The next method returns true until there are no more rows in the ResultSet, when it returns false.

The default type of ResultSet cannot be updated and its cursor can only move forward through the rows of data. This means that it is only possible to read through it once. However, it is possible to create types of ResultSet that can be updated and also types where the cursor can be scrolled forward and backward through the rows of data. This is shown in the following code example: Connection con; Statement aStatement = con.createStatement( ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE ); ResultSet theResultSet = theStatement.executeQuery("SELECT price, quantity FROM STOCKTABLE"); // theResultSet will be both scrollable and updateable

The ResultSet interface provides a series of methods for retrieving data from columns in the current row, such as getDate, getFloat. The columns are identified either by their index number (starting at 1) or by their name - there are separate methods for both techniques of column addressing. The column names are case insensitive. If several columns have the same name, then the getter methods use the first matching column. This means that if column names are used, it is not possible to guarantee that the name will retrieve data from the intended column - for certainty it is better to use column indexes. Ideally the columns should be read left-to-right and read once only, since not all * databases are optimized to handle other techniques of reading the data.

When reading data, the JDBC driver maps the SQL data retrieved from the database to the Java type implied by the method invoked by the application. The JDBC specification has a table of allowable mappings from SQL types to Java types.

There are also methods for writing data into the ResultSet, such as updateInt, updateString. The update methods can be used either to modify the data of an existing row or to insert new data rows into the ResultSet. Modification of existing data involves moving the Cursor to the row which needs modification and then using the update methods to modify the data, followed by calling the ResultSet.updateRow method. For insertion of new rows, the cursor is first moved to a special row called the Insert Row, data is added using the update methods, followed by calling the ResultSet.insertRow method.

A ResultSet is closed if the Statement object which generated it closed, executed again or is used to retrieve the next result from a sequence of results.

Known Indirect Subclasses

Summary

Constants

      Value  
int  CLOSE_CURSORS_AT_COMMIT  A constant used to indicate that a ResultSet object must be closed when the method Connection.commit is invoked.  0x00000002 
int  CONCUR_READ_ONLY  A constant used to indicate the Concurrency Mode for a ResultSet object that cannot be updated.  1007  0x000003ef 
int  CONCUR_UPDATABLE  A constant used to indicate the Concurrency Mode for a ResultSet object that can be updated.  1008  0x000003f0 
int  FETCH_FORWARD  A constant used to indicate processing of the rows of a ResultSet in the forward direction, first to last   1000  0x000003e8 
int  FETCH_REVERSE  A constant used to indicate processing of the rows of a ResultSet in the reverse direction, last to first   1001  0x000003e9 
int  FETCH_UNKNOWN  A constant used to indicate that the order of processing of the rows of a ResultSet is unknown.  1002  0x000003ea 
int  HOLD_CURSORS_OVER_COMMIT  A constant used to indicate that a ResultSet object must not be closed when the method Connection.commit is invoked.  0x00000001 
int  TYPE_FORWARD_ONLY  A constant used to indicate a ResultSet object whose Cursor can only move forward   1003  0x000003eb 
int  TYPE_SCROLL_INSENSITIVE  A constant used to indicate a ResultSet object which is Scrollable but which is not sensitive to changes made by others   1004  0x000003ec 
int  TYPE_SCROLL_SENSITIVE  A constant used to indicate a ResultSet object which is Scrollable but which is sensitive to changes made by others   1005  0x000003ed 

Public Methods

          boolean  absolute(int row)
Moves the Cursor to a specified row number in the ResultSet.
          void  afterLast()
Moves the Cursor to the end of the ResultSet, after the last row.
          void  beforeFirst()
Moves the Cursor to the start of the ResultSet, before the first row.
          void  cancelRowUpdates()
Cancels any updates made to the current row in the ResultSet.
          void  clearWarnings()
Clears all the warnings related to this ResultSet.
          void  close()
Releases this ResultSet's database and JDBC resources.
          void  deleteRow()
Deletes the current row from the ResultSet and from the underlying database.
          int  findColumn(String columnName)
Gets the index number for a column in the ResultSet from the provided Column Name.
          boolean  first()
Shifts the cursor position to the first row in the ResultSet.
          Array  getArray(String colName)
Gets the value of a column specified as a column name as a java.sql.Array.
          Array  getArray(int columnIndex)
Gets the content of a column specified as a column index in the current row of this ResultSet as a java.sql.Array.
          InputStream  getAsciiStream(String columnName)
Gets the value of a column specified as a column name as an ASCII character stream.
          InputStream  getAsciiStream(int columnIndex)
Gets the value of a column specified as a column index as an ASCII character stream.
          BigDecimal  getBigDecimal(String columnName, int scale)
This method is deprecated. Gets the value of a column specified as a column name, as a java.math.BigDecimal.
          BigDecimal  getBigDecimal(int columnIndex, int scale)
This method is deprecated. Gets the value of a column specified as a column index as a java.math.BigDecimal.
          BigDecimal  getBigDecimal(int columnIndex)
Gets the value of a column specified as a column index as a java.math.BigDecimal.
          BigDecimal  getBigDecimal(String columnName)
Gets the value of a column specified as a column name, as a java.math.BigDecimal.
          InputStream  getBinaryStream(int columnIndex)
Gets the value of a column specified as a column index as a binary stream.
          InputStream  getBinaryStream(String columnName)
Gets the value of a column specified as a column name as a binary stream.
          Blob  getBlob(int columnIndex)
Gets the value of a column specified as a column index as a java.sql.Blob object.
          Blob  getBlob(String columnName)
Gets the value of a column specified as a column name, as a java.sql.Blob object.
          boolean  getBoolean(int columnIndex)
Gets the value of a column specified as a column index as a boolean.
          boolean  getBoolean(String columnName)
Gets the value of a column specified as a column name, as a boolean.
          byte  getByte(int columnIndex)
Gets the value of a column specified as a column index as a byte.
          byte  getByte(String columnName)
Gets the value of a column specified as a column name as a byte.
          byte[]  getBytes(int columnIndex)
Gets the value of a column specified as a column index as a byte array.
          byte[]  getBytes(String columnName)
Gets the value of a column specified as a column name as a byte array.
          Reader  getCharacterStream(int columnIndex)
Gets the value of a column specified as a column index as a java.io.Reader object.
          Reader  getCharacterStream(String columnName)
Gets the value of a column specified as a column name as a java.io.Reader object.
          Clob  getClob(String colName)
Gets the value of a column specified as a column name as a java.sql.Clob.
          Clob  getClob(int columnIndex)
Gets the value of a column specified as a column index as a java.sql.Clob.
          int  getConcurrency()
Gets the concurrency mode of this ResultSet.
          String  getCursorName()
Gets the name of the SQL cursor of this ResultSet.
          Date  getDate(String columnName, Calendar cal)
Gets the value of a column specified as a column name, as a java.sql.Date object.
          Date  getDate(int columnIndex)
Gets the value of a column specified as a column index as a java.sql.Date.
          Date  getDate(String columnName)
Gets the value of a column specified as a column name as a java.sql.Date.
          Date  getDate(int columnIndex, Calendar cal)
Gets the value of a column specified as a column index as a java.sql.Date.
          double  getDouble(int columnIndex)
Gets the value of a column specified as a column index as a double value.
          double  getDouble(String columnName)
Gets the value of a column specified as a column name as a double value.
          int  getFetchDirection()
Gets the direction in which rows are fetched for this ResultSet object.
          int  getFetchSize()
Gets the fetch size (in number of rows) for this ResultSet
          float  getFloat(int columnIndex)
Gets the value of a column specified as a column index as a float value.
          float  getFloat(String columnName)
Gets the value of a column specified as a column name as a float value.
          int  getInt(String columnName)
Gets the value of a column specified as a column name, as an int value.
          int  getInt(int columnIndex)
Gets the value of a column specified as a column index as an int value.
          long  getLong(String columnName)
Gets the value of a column specified as a column name, as a long value.
          long  getLong(int columnIndex)
Gets the value of a column specified as a column index as a long value.
          ResultSetMetaData  getMetaData()
Gets the Metadata for this ResultSet.
          Object  getObject(String columnName, Map<StringClass<?>> map)
Gets the value of a column specified as a column name as a Java Object.
          Object  getObject(String columnName)
Gets the value of a specified column as a Java Object.
          Object  getObject(int columnIndex, Map<StringClass<?>> map)
Gets the value of a column specified as a column index as a Java Object.
          Object  getObject(int columnIndex)
Gets the value of a specified column as a Java Object.
          Ref  getRef(String colName)
Gets the value of a column specified as a column name as a Java java.sql.Ref.
          Ref  getRef(int columnIndex)
Gets the value of a column specified as a column index as a Java java.sql.Ref.
          int  getRow()
Gets the number of the current row in the ResultSet.
          short  getShort(int columnIndex)
Gets the value of a column specified as a column index as a short value.
          short  getShort(String columnName)
Gets the value of a column specified as a column name, as a short value.
          Statement  getStatement()
Gets the Statement that produced this ResultSet.
          String  getString(String columnName)
Gets the value of a column specified as a column name, as a String.
          String  getString(int columnIndex)
Gets the value of a column specified as a column index as a String.
          Time  getTime(int columnIndex, Calendar cal)
Gets the value of a column specified as a column index as a java.sql.Time value.
          Time  getTime(String columnName, Calendar cal)
Gets the value of a column specified as a column index, as a java.sql.Time value.
          Time  getTime(int columnIndex)
Gets the value of a column specified as a column index as a java.sql.Time value.
          Time  getTime(String columnName)
Gets the value of a column specified as a column name, as a java.sql.Time value.
          Timestamp  getTimestamp(String columnName)
Gets the value of a column specified as a column name, as a java.sql.Timestamp value.
          Timestamp  getTimestamp(int columnIndex)
Gets the value of a column specified as a column index as a java.sql.Timestamp value.
          Timestamp  getTimestamp(int columnIndex, Calendar cal)
Gets the value of a column specified as a column index, as a java.sql.Timestamp value.
          Timestamp  getTimestamp(String columnName, Calendar cal)
Gets the value of a column specified as a column name, as a java.sql.Timestamp value.
          int  getType()
Gets the type of the ResultSet.
          URL  getURL(int columnIndex)
Gets the value of a column specified as a column index as a java.net.URL.
          URL  getURL(String columnName)
Gets the value of a column specified as a column name as a java.net.URL object.
          InputStream  getUnicodeStream(String columnName)
This method is deprecated. Use getCharacterStream(int)

Gets the value of the column as an InputStream of Unicode characters.

          InputStream  getUnicodeStream(int columnIndex)
This method is deprecated. Use getCharacterStream(int).

Gets the value of the column as an InputStream of Unicode characters.

          SQLWarning  getWarnings()
Gets the first warning generated by calls on this ResultSet.
          void  insertRow()
Insert the insert row into the ResultSet and into the underlying database.
          boolean  isAfterLast()
Gets if the cursor is after the last row of the ResultSet.
          boolean  isBeforeFirst()
Gets if the cursor is before the first row of the ResultSet.
          boolean  isFirst()
Gets if the cursor is on the first row of the ResultSet.
          boolean  isLast()
Gets if the cursor is on the last row of the ResultSet
          boolean  last()
Shifts the cursor position to the last row of the ResultSet.
          void  moveToCurrentRow()
Moves the cursor to the remembered position, usually the current row.
          void  moveToInsertRow()
Moves the cursor position to the Insert row.
          boolean  next()
Shifts the cursor position down one row in this ResultSet object.
          boolean  previous()
Relocates the cursor position to the preceding row in this ResultSet.
          void  refreshRow()
Refreshes the current row with its most up to date value in the database.
          boolean  relative(int rows)
Moves the cursor position up or down by a specified number of rows.
          boolean  rowDeleted()
Indicates whether a row has been deleted.
          boolean  rowInserted()
Indicates whether the current row has had an insertion operation.
          boolean  rowUpdated()
Indicates whether the current row has been updated.
          void  setFetchDirection(int direction)
Indicates which direction (forward/reverse) will be used to process the rows of this ResultSet object.
          void  setFetchSize(int rows)
Indicates the amount of rows to fetch from the database when extra rows are required for this ResultSet.
          void  updateArray(int columnIndex, Array x)
Updates a column specified by a column index with a java.sql.Array value.
          void  updateArray(String columnName, Array x)
Updates a column specified by a column name with a java.sql.Array value.
          void  updateAsciiStream(String columnName, InputStream x, int length)
Updates a column specified by a column name with an Ascii stream value.
          void  updateAsciiStream(int columnIndex, InputStream x, int length)
Updates a column specified by a column index with an ASCII stream value.
          void  updateBigDecimal(int columnIndex, BigDecimal x)
Updates a column specified by a column index with a java.sql.BigDecimal value.
          void  updateBigDecimal(String columnName, BigDecimal x)
Updates a column specified by a column name with a java.sql.BigDecimal value.
          void  updateBinaryStream(String columnName, InputStream x, int length)
Updates a column specified by a column name with a binary stream value.
          void  updateBinaryStream(int columnIndex, InputStream x, int length)
Updates a column specified by a column index with a binary stream value.
          void  updateBlob(int columnIndex, Blob x)
Updates a column specified by a column index with a java.sql.Blob value.
          void  updateBlob(String columnName, Blob x)
Updates a column specified by a column name with a java.sql.Blob value.
          void  updateBoolean(String columnName, boolean x)
Updates a column specified by a column name with a boolean value.
          void  updateBoolean(int columnIndex, boolean x)
Updates a column specified by a column index with a boolean value.
          void  updateByte(String columnName, byte x)
Updates a column specified by a column name with a byte value.
          void  updateByte(int columnIndex, byte x)
Updates a column specified by a column index with a byte value.
          void  updateBytes(String columnName, byte[] x)
Updates a column specified by a column name with a byte array value.
          void  updateBytes(int columnIndex, byte[] x)
Updates a column specified by a column index with a byte array value.
          void  updateCharacterStream(int columnIndex, Reader x, int length)
Updates a column specified by a column index with a character stream value.
          void  updateCharacterStream(String columnName, Reader reader, int length)
Updates a column specified by a column name with a character stream value.
          void  updateClob(String columnName, Clob x)
Updates a column specified by a column name with a java.sql.Clob value.
          void  updateClob(int columnIndex, Clob x)
Updates a column specified by a column index with a java.sql.Clob value.
          void  updateDate(String columnName, Date x)
Updates a column specified by a column name with a java.sql.Date value.
          void  updateDate(int columnIndex, Date x)
Updates a column specified by a column index with a java.sql.Date value.
          void  updateDouble(int columnIndex, double x)
Updates a column specified by a column index with a double value.
          void  updateDouble(String columnName, double x)
Updates a column specified by a column name with a double value.
          void  updateFloat(int columnIndex, float x)
Updates a column specified by a column index with a float value.
          void  updateFloat(String columnName, float x)
Updates a column specified by a column name with a float value.
          void  updateInt(String columnName, int x)
Updates a column specified by a column name with an int value.
          void  updateInt(int columnIndex, int x)
Updates a column specified by a column index with an int value.
          void  updateLong(int columnIndex, long x)
Updates a column specified by a column index with a long value.
          void  updateLong(String columnName, long x)
Updates a column specified by a column name with a long value.
          void  updateNull(int columnIndex)
Updates a column specified by a column index with a null value.
          void  updateNull(String columnName)
Updates a column specified by a column name with a null value.
          void  updateObject(int columnIndex, Object x)
Updates a column specified by a column index with an Object value.
          void  updateObject(int columnIndex, Object x, int scale)
Updates a column specified by a column index with an Object value.
          void  updateObject(String columnName, Object x)
Updates a column specified by a column name with an Object value.
          void  updateObject(String columnName, Object x, int scale)
Updates a column specified by a column name with an Object value.
          void  updateRef(int columnIndex, Ref x)
Updates a column specified by a column index with a java.sql.Ref value.
          void  updateRef(String columnName, Ref x)
Updates a column specified by a column name with a java.sql.Ref value.
          void  updateRow()
Updates the database with the new contents of the current row of this ResultSet object.
          void  updateShort(String columnName, short x)
Updates a column specified by a column name with a short value.
          void  updateShort(int columnIndex, short x)
Updates a column specified by a column index with a short value.
          void  updateString(String columnName, String x)
Updates a column specified by a column name with a String value.
          void  updateString(int columnIndex, String x)
Updates a column specified by a column index with a String value.
          void  updateTime(int columnIndex, Time x)
Updates a column specified by a column index with a Time value.
          void  updateTime(String columnName, Time x)
Updates a column specified by a column name with a Time value.
          void  updateTimestamp(int columnIndex, Timestamp x)
Updates a column specified by a column index with a Timestamp value.
          void  updateTimestamp(String columnName, Timestamp x)
Updates a column specified by column name with a Timestamp value.
          boolean  wasNull()
Determines if the last column read from this ResultSet contained SQL NULL.

Details

Constants

public static final int CLOSE_CURSORS_AT_COMMIT

A constant used to indicate that a ResultSet object must be closed when the method Connection.commit is invoked.
Constant Value: 2 (0x00000002)

public static final int CONCUR_READ_ONLY

A constant used to indicate the Concurrency Mode for a ResultSet object that cannot be updated.
Constant Value: 1007 (0x000003ef)

public static final int CONCUR_UPDATABLE

A constant used to indicate the Concurrency Mode for a ResultSet object that can be updated.
Constant Value: 1008 (0x000003f0)

public static final int FETCH_FORWARD

A constant used to indicate processing of the rows of a ResultSet in the forward direction, first to last
Constant Value: 1000 (0x000003e8)

public static final int FETCH_REVERSE

A constant used to indicate processing of the rows of a ResultSet in the reverse direction, last to first
Constant Value: 1001 (0x000003e9)

public static final int FETCH_UNKNOWN

A constant used to indicate that the order of processing of the rows of a ResultSet is unknown.
Constant Value: 1002 (0x000003ea)

public static final int HOLD_CURSORS_OVER_COMMIT

A constant used to indicate that a ResultSet object must not be closed when the method Connection.commit is invoked.
Constant Value: 1 (0x00000001)

public static final int TYPE_FORWARD_ONLY

A constant used to indicate a ResultSet object whose Cursor can only move forward
Constant Value: 1003 (0x000003eb)

public static final int TYPE_SCROLL_INSENSITIVE

A constant used to indicate a ResultSet object which is Scrollable but which is not sensitive to changes made by others
Constant Value: 1004 (0x000003ec)

public static final int TYPE_SCROLL_SENSITIVE

A constant used to indicate a ResultSet object which is Scrollable but which is sensitive to changes made by others
Constant Value: 1005 (0x000003ed)

Public Methods

public boolean absolute(int row)

Moves the Cursor to a specified row number in the ResultSet.

Parameters

row The new row number for the Cursor

Returns

  • true if the new Cursor position is on the ResultSet, false otherwise

Throws

SQLException if a database error happens

public void afterLast()

Moves the Cursor to the end of the ResultSet, after the last row.

Throws

SQLException if a database error happens

public void beforeFirst()

Moves the Cursor to the start of the ResultSet, before the first row.

Throws

SQLException if a database error happens

public void cancelRowUpdates()

Cancels any updates made to the current row in the ResultSet.

Throws

SQLException if a database error happens

public void clearWarnings()

Clears all the warnings related to this ResultSet.

Throws

SQLException if a database error happens

public void close()

Releases this ResultSet's database and JDBC resources. You are strongly advised to use this method rather than relying on the release being done when the ResultSet's finalize method is called during garbage collection process. Note that the close() method might take some time to complete since it is dependent on the behaviour of the connection to the database and the database itself.

Throws

SQLException if a database error happens

public void deleteRow()

Deletes the current row from the ResultSet and from the underlying database.

Throws

SQLException if a database error happens

public int findColumn(String columnName)

Gets the index number for a column in the ResultSet from the provided Column Name.

Parameters

columnName the column name

Returns

  • the index of the column in the ResultSet for the column name

Throws

SQLException if a database error happens

public boolean first()

Shifts the cursor position to the first row in the ResultSet.

Returns

  • true if the position is in a legitimate row, false if the ResultSet contains no rows.

Throws

SQLException if a database error happens

public Array getArray(String colName)

Gets the value of a column specified as a column name as a java.sql.Array.

Parameters

colName the name of the column to read

Returns

  • a java.sql.Array with the data from the column

Throws

SQLException if a database error happens

public Array getArray(int columnIndex)

Gets the content of a column specified as a column index in the current row of this ResultSet as a java.sql.Array.

Parameters

columnIndex the index of the column to read

Returns

  • a java.sql.Array with the data from the column

Throws

SQLException if a database error happens

public InputStream getAsciiStream(String columnName)

Gets the value of a column specified as a column name as an ASCII character stream.

Parameters

columnName the name of the column to read

Returns

  • an InputStream with the data from the column

Throws

SQLException if a database error happens

public InputStream getAsciiStream(int columnIndex)

Gets the value of a column specified as a column index as an ASCII character stream.

Parameters

columnIndex the index of the column to read

Returns

  • an InputStream with the data from the column

Throws

SQLException if a database error happens

public BigDecimal getBigDecimal(String columnName, int scale)

This method is deprecated. Gets the value of a column specified as a column name, as a java.math.BigDecimal.

Parameters

columnName the name of the column to read
scale the number of digits after the decimal point

Returns

  • a BigDecimal with the value of the column

Throws

SQLException if a database error happens

public BigDecimal getBigDecimal(int columnIndex, int scale)

This method is deprecated. Gets the value of a column specified as a column index as a java.math.BigDecimal.

Parameters

columnIndex the index of the column to read
scale the number of digits after the decimal point

Returns

  • a BigDecimal with the value of the column

Throws

SQLException if a database error happens

public BigDecimal getBigDecimal(int columnIndex)

Gets the value of a column specified as a column index as a java.math.BigDecimal.

Parameters

columnIndex the index of the column to read

Returns

  • a BigDecimal with the value of the column

Throws

SQLException if a database error happens

public BigDecimal getBigDecimal(String columnName)

Gets the value of a column specified as a column name, as a java.math.BigDecimal.

Parameters

columnName the name of the column to read

Returns

  • a BigDecimal with the value of the column

Throws

SQLException if a database error happens

public InputStream getBinaryStream(int columnIndex)

Gets the value of a column specified as a column index as a binary stream.

This method can be used to read LONGVARBINARY values. All of the data in the InputStream should be read before getting data from any other column. A further call to a getter method will implicitly close the InputStream.

Parameters

columnIndex the index of the column to read

Returns

  • an InputStream with the data from the column. If the column value is SQL NULL, null is returned.

Throws

SQLException if a database error happens

public InputStream getBinaryStream(String columnName)

Gets the value of a column specified as a column name as a binary stream.

This method can be used to read LONGVARBINARY values. All of the data in the InputStream should be read before getting data from any other column. A further call to a getter method will implicitly close the InputStream.

Parameters

columnName the name of the column to read

Returns

  • an InputStream with the data from the column If the column value is SQL NULL, null is returned.

Throws

SQLException if a database error happens

public Blob getBlob(int columnIndex)

Gets the value of a column specified as a column index as a java.sql.Blob object.

Parameters

columnIndex the index of the column to read

Returns

  • a java.sql.Blob with the value of the column

Throws

SQLException if a database error happens

public Blob getBlob(String columnName)

Gets the value of a column specified as a column name, as a java.sql.Blob object.

Parameters

columnName the name of the column to read

Returns

  • a java.sql.Blob with the value of the column

Throws

SQLException if a database error happens

public boolean getBoolean(int columnIndex)

Gets the value of a column specified as a column index as a boolean.

Parameters

columnIndex the index of the column to read

Returns

  • a boolean value from the column. If the column is SQL NULL, false is returned.

Throws

SQLException if a database error happens

public boolean getBoolean(String columnName)

Gets the value of a column specified as a column name, as a boolean.

Parameters

columnName the name of the column to read

Returns

  • a boolean value from the column. If the column is SQL NULL, false is returned.

Throws

SQLException if a database error happens

public byte getByte(int columnIndex)

Gets the value of a column specified as a column index as a byte.

Parameters

columnIndex the index of the column to read

Returns

  • a byte containing the value of the column. 0 if the value is SQL NULL.

Throws

SQLException if a database error happens

public byte getByte(String columnName)

Gets the value of a column specified as a column name as a byte.

Parameters

columnName the name of the column to read

Returns

  • a byte containing the value of the column. 0 if the value is SQL NULL.

Throws

SQLException if a database error happens

public byte[] getBytes(int columnIndex)

Gets the value of a column specified as a column index as a byte array.

Parameters

columnIndex the index of the column to read

Returns

  • a byte array containing the value of the column. null if the column contains SQL NULL.

Throws

SQLException if a database error happens

public byte[] getBytes(String columnName)

Gets the value of a column specified as a column name as a byte array.

Parameters

columnName the name of the column to read

Returns

  • a byte array containing the value of the column. null if the column contains SQL NULL.

Throws

SQLException if a database error happens

public Reader getCharacterStream(int columnIndex)

Gets the value of a column specified as a column index as a java.io.Reader object.

Parameters

columnIndex the index of the column to read

Returns

  • a Reader holding the value of the column. null if the column value is SQL NULL.

Throws

SQLException if a database error happens

public Reader getCharacterStream(String columnName)

Gets the value of a column specified as a column name as a java.io.Reader object.

Parameters

columnName the name of the column to read

Returns

  • a Reader holding the value of the column. null if the column value is SQL NULL.

Throws

SQLException if a database error happens

public Clob getClob(String colName)

Gets the value of a column specified as a column name as a java.sql.Clob.

Parameters

colName the name of the column to read

Returns

  • a Clob object representing the value in the column. null if the value is SQL NULL.

Throws

SQLException if a database error happens

public Clob getClob(int columnIndex)

Gets the value of a column specified as a column index as a java.sql.Clob.

Parameters

columnIndex the index of the column to read

Returns

  • a Clob object representing the value in the column. null if the value is SQL NULL.

Throws

SQLException if a database error happens

public int getConcurrency()

Gets the concurrency mode of this ResultSet.

Returns

  • the concurrency mode - one of: ResultSet.CONCUR_READ_ONLY, ResultSet.CONCUR_UPDATABLE

Throws

SQLException if a database error happens

public String getCursorName()

Gets the name of the SQL cursor of this ResultSet.

Returns

  • a String containing the SQL cursor name

Throws

SQLException if a database error happens

public Date getDate(String columnName, Calendar cal)

Gets the value of a column specified as a column name, as a java.sql.Date object.

Parameters

columnName the name of the column to read
cal java.util.Calendar to use in constructing the Date.

Returns

  • a java.sql.Date matching the column value. null if the column is SQL NULL.

Throws

SQLException if a database error happens

public Date getDate(int columnIndex)

Gets the value of a column specified as a column index as a java.sql.Date.

Parameters

columnIndex the index of the column to read

Returns

  • a java.sql.Date matching the column value. null if the column is SQL NULL.

Throws

SQLException if a database error happens

public Date getDate(String columnName)

Gets the value of a column specified as a column name as a java.sql.Date.

Parameters

columnName the name of the column to read

Returns

  • a java.sql.Date matching the column value. null if the column is SQL NULL.

Throws

SQLException if a database error happens

public Date getDate(int columnIndex, Calendar cal)

Gets the value of a column specified as a column index as a java.sql.Date. This method uses a supplied calendar to compute the Date.

Parameters

columnIndex the index of the column to read
cal a java.util.Calendar to use in constructing the Date.

Returns

  • a java.sql.Date matching the column value. null if the column is SQL NULL.

Throws

SQLException if a database error happens

public double getDouble(int columnIndex)

Gets the value of a column specified as a column index as a double value.

Parameters

columnIndex the index of the column to read

Returns

  • a double containing the column value. 0.0 if the column is SQL NULL.

Throws

SQLException if a database error happens

public double getDouble(String columnName)

Gets the value of a column specified as a column name as a double value.

Parameters

columnName the name of the column to read

Returns

  • a double containing the column value. 0.0 if the column is SQL NULL.

Throws

SQLException if a database error happens

public int getFetchDirection()

Gets the direction in which rows are fetched for this ResultSet object.

Returns

  • the fetch direction. Will be: ResultSet.FETCH_FORWARD, ResultSet.FETCH_REVERSE or ResultSet.FETCH_UNKNOWN

Throws

SQLException if a database error happens

public int getFetchSize()

Gets the fetch size (in number of rows) for this ResultSet

Returns

  • the fetch size as an int

Throws

SQLException if a database error happens

public float getFloat(int columnIndex)

Gets the value of a column specified as a column index as a float value.

Parameters

columnIndex the index of the column to read

Returns

  • a float containing the column value. 0.0 if the column is SQL NULL.

Throws

SQLException if a database error happens

public float getFloat(String columnName)

Gets the value of a column specified as a column name as a float value.

Parameters

columnName the name of the column to read

Returns

  • a float containing the column value. 0.0 if the column is SQL NULL.

Throws

SQLException if a database error happens

public int getInt(String columnName)

Gets the value of a column specified as a column name, as an int value.

Parameters

columnName the name of the column to read

Returns

  • an int containing the column value. 0 if the column is SQL NULL.

Throws

SQLException if a database error happens

public int getInt(int columnIndex)

Gets the value of a column specified as a column index as an int value.

Parameters

columnIndex the index of the column to read

Returns

  • an int containing the column value. 0 if the column is SQL NULL.

Throws

SQLException if a database error happens

public long getLong(String columnName)

Gets the value of a column specified as a column name, as a long value.

Parameters

columnName the name of the column to read

Returns

  • a long containing the column value. 0 if the column is SQL NULL.

Throws

SQLException if a database error happens

public long getLong(int columnIndex)

Gets the value of a column specified as a column index as a long value.

Parameters

columnIndex the index of the column to read

Returns

  • a long containing the column value. 0 if the column is SQL NULL.

Throws

SQLException if a database error happens

public ResultSetMetaData getMetaData()

Gets the Metadata for this ResultSet. This defines the number, types and properties of the columns in the ResultSet.

Returns

  • a ResultSetMetaData object with information about this ResultSet.

Throws

SQLException if a database error happens

public Object getObject(String columnName, Map<StringClass<?>> map)

Gets the value of a column specified as a column name as a Java Object.

The type of the Java object will be determined by the supplied Map to perform the mapping of SQL Struct or Distinct types into Java objects.

Parameters

columnName the name of the column to read
map a java.util.Map containing a mapping from SQL Type names to Java classes.

Returns

  • an Object containing the value of the column. null if the column value is SQL NULL.

Throws

SQLException if a database error happens

public Object getObject(String columnName)

Gets the value of a specified column as a Java Object. The type of the returned object will be the default according to the column's SQL type, following the JDBC specification for built-in types.

For SQL User Defined Types, if a column value is Structured or Distinct, this method behaves the same as a call to: getObject(columnIndex, this.getStatement().getConnection().getTypeMap())

Parameters

columnName the name of the column to read

Returns

  • an Object containing the value of the column. null if the column value is SQL NULL.

Throws

SQLException if a database error happens

public Object getObject(int columnIndex, Map<StringClass<?>> map)

Gets the value of a column specified as a column index as a Java Object.

The type of the Java object will be determined by the supplied Map to perform the mapping of SQL Struct or Distinct types into Java objects.

Parameters

columnIndex the index of the column to read
map a java.util.Map containing a mapping from SQL Type names to Java classes.

Returns

  • an Object containing the value of the column. null if the column value is SQL NULL.

Throws

SQLException if a database error happens

public Object getObject(int columnIndex)

Gets the value of a specified column as a Java Object. The type of the returned object will be the default according to the column's SQL type, following the JDBC specification for built-in types.

For SQL User Defined Types, if a column value is Structured or Distinct, this method behaves the same as a call to: getObject(columnIndex, this.getStatement().getConnection().getTypeMap())

Parameters

columnIndex the index of the column to read

Returns

  • an Object containing the value of the column. null if the column value is SQL NULL.

Throws

SQLException if a database error happens

public Ref getRef(String colName)

Gets the value of a column specified as a column name as a Java java.sql.Ref.

Parameters

colName the name of the column to read

Returns

  • a Ref representing the value of the SQL REF in the column

Throws

SQLException if a database error happens

public Ref getRef(int columnIndex)

Gets the value of a column specified as a column index as a Java java.sql.Ref.

Parameters

columnIndex the index of the column to read

Returns

  • a Ref representing the value of the SQL REF in the column

Throws

SQLException if a database error happens

public int getRow()

Gets the number of the current row in the ResultSet. Row numbers start at 1 for the first row.

Returns

  • the index number of the current row. 0 is returned if there is no current row.

Throws

SQLException if a database error happens

public short getShort(int columnIndex)

Gets the value of a column specified as a column index as a short value.

Parameters

columnIndex the index of the column to read

Returns

  • a short value containing the value of the column. 0 if the value is SQL NULL.

Throws

SQLException if a database error happens

public short getShort(String columnName)

Gets the value of a column specified as a column name, as a short value.

Parameters

columnName the name of the column to read

Returns

  • a short value containing the value of the column. 0 if the value is SQL NULL.

Throws

SQLException if a database error happens

public Statement getStatement()

Gets the Statement that produced this ResultSet. If the ResultSet was not created by a Statement (eg it was returned from one of the DatabaseMetaData methods), null is returned.

Returns

  • the Statement which produced this ResultSet, or null if the ResultSet was not created by a Statement.

Throws

SQLException

public String getString(String columnName)

Gets the value of a column specified as a column name, as a String.

Parameters

columnName the name of the column to read

Returns

  • the String representing the value of the column, null if the column is SQL NULL.

Throws

SQLException if a database error happens

public String getString(int columnIndex)

Gets the value of a column specified as a column index as a String.

Parameters

columnIndex the index of the column to read

Returns

  • the String representing the value of the column, null if the column is SQL NULL.

Throws

SQLException if a database error happens

public Time getTime(int columnIndex, Calendar cal)

Gets the value of a column specified as a column index as a java.sql.Time value. The supplied Calendar is used to map between the SQL Time value and the Java Time value.

Parameters

columnIndex the index of the column to read
cal a Calendar to use in creating the Java Time value.

Returns

  • a Time representing the column value, null if the column value is SQL NULL.

Throws

SQLException if a database error happens

public Time getTime(String columnName, Calendar cal)

Gets the value of a column specified as a column index, as a java.sql.Time value. The supplied Calendar is used to map between the SQL Time value and the Java Time value.

Parameters

columnName the name of the column to read
cal a Calendar to use in creating the Java Time value.

Returns

  • a Time representing the column value, null if the column value is SQL NULL.

Throws

SQLException if a database error happens

public Time getTime(int columnIndex)

Gets the value of a column specified as a column index as a java.sql.Time value.

Parameters

columnIndex the index of the column to read

Returns

  • a Time representing the column value, null if the column value is SQL NULL.

Throws

SQLException if a database error happens

public Time getTime(String columnName)

Gets the value of a column specified as a column name, as a java.sql.Time value.

Parameters

columnName the name of the column to read

Returns

  • a Time representing the column value, null if the column value is SQL NULL.

Throws

SQLException if a database error happens

public Timestamp getTimestamp(String columnName)

Gets the value of a column specified as a column name, as a java.sql.Timestamp value.

Parameters

columnName the name of the column to read

Returns

  • a Timestamp representing the column value, null if the column value is SQL NULL.

Throws

SQLException if a database error happens

public Timestamp getTimestamp(int columnIndex)

Gets the value of a column specified as a column index as a java.sql.Timestamp value.

Parameters

columnIndex the index of the column to read

Returns

  • a Timestamp representing the column value, null if the column value is SQL NULL.

Throws

SQLException if a database error happens

public Timestamp getTimestamp(int columnIndex, Calendar cal)

Gets the value of a column specified as a column index, as a java.sql.Timestamp value. The supplied Calendar is used to map between the SQL Timestamp value and the Java Timestamp value.

Parameters

columnIndex the index of the column to read
cal Calendar to use in creating the Java Timestamp value.

Returns

  • a Timestamp representing the column value, null if the column value is SQL NULL.

Throws

SQLException if a database error happens

public Timestamp getTimestamp(String columnName, Calendar cal)

Gets the value of a column specified as a column name, as a java.sql.Timestamp value. The supplied Calendar is used to map between the SQL Timestamp value and the Java Timestamp value.

Parameters

columnName the name of the column to read
cal Calendar to use in creating the Java Timestamp value.

Returns

  • a Timestamp representing the column value, null if the column value is SQL NULL.

Throws

SQLException if a database error happens

public int getType()

Gets the type of the ResultSet.

Returns

  • The ResultSet type, one of: ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE

Throws

SQLException if there is a database error

public URL getURL(int columnIndex)

Gets the value of a column specified as a column index as a java.net.URL.

Parameters

columnIndex the index of the column to read

Returns

  • a URL. null if the column value is SQL NULL.

Throws

SQLException if a database error happens

public URL getURL(String columnName)

Gets the value of a column specified as a column name as a java.net.URL object.

Parameters

columnName the name of the column to read

Returns

  • a URL. null if the column value is SQL NULL.

Throws

SQLException if a database error happens

public InputStream getUnicodeStream(String columnName)

This method is deprecated. Use getCharacterStream(int)

Gets the value of the column as an InputStream of Unicode characters.

Parameters

columnName the name of the column to read

Returns

  • an InputStream holding the value of the column. null if the column value is SQL NULL.

Throws

SQLException if a database error happens

public InputStream getUnicodeStream(int columnIndex)

This method is deprecated. Use getCharacterStream(int).

Gets the value of the column as an InputStream of Unicode characters.

Parameters

columnIndex the index of the column to read

Returns

  • an InputStream holding the value of the column. null if the column value is SQL NULL.

Throws

SQLException if a database error happens

public SQLWarning getWarnings()

Gets the first warning generated by calls on this ResultSet. Subsequent warnings on this ResultSet are chained to the first one.

The warnings are cleared when a new Row is read from the ResultSet. The warnings returned by this method are only the warnings generated by ResultSet method calls - warnings generated by Statement methods are held by the Statement.

An SQLException is generated if this method is called on a closed ResultSet.

Returns

  • an SQLWarning which is the first warning for this ResultSet. null if there are no warnings.

Throws

SQLException if a database error happens

public void insertRow()

Insert the insert row into the ResultSet and into the underlying database. The Cursor must be set to the Insert Row before this method is invoked.

Throws

SQLException if a database error happens. Particular cases include the Cursor not being on the Insert Row or if any Columns in the Row do not have a value where the column is declared as not-nullable.

public boolean isAfterLast()

Gets if the cursor is after the last row of the ResultSet.

Returns

  • true if the Cursor is after the last Row in the ResultSet, false if the cursor is at any other position in the ResultSet.

Throws

SQLException if a database error happens

public boolean isBeforeFirst()

Gets if the cursor is before the first row of the ResultSet.

Returns

  • true if the Cursor is before the last Row in the ResultSet, false if the cursor is at any other position in the ResultSet.

Throws

SQLException if a database error happens

public boolean isFirst()

Gets if the cursor is on the first row of the ResultSet.

Returns

  • true if the Cursor is on the first Row in the ResultSet, false if the cursor is at any other position in the ResultSet.

Throws

SQLException if a database error happens

public boolean isLast()

Gets if the cursor is on the last row of the ResultSet

Returns

  • true if the Cursor is on the last Row in the ResultSet, false if the cursor is at any other position in the ResultSet.

Throws

SQLException

public boolean last()

Shifts the cursor position to the last row of the ResultSet.

Returns

  • true if the new position is in a legitimate row, false if the ResultSet contains no rows.

Throws

SQLException if there is a database error

public void moveToCurrentRow()

Moves the cursor to the remembered position, usually the current row. This only applies if the cursor is on the Insert row.

Throws

SQLException if a database error happens

public void moveToInsertRow()

Moves the cursor position to the Insert row. The current position is remembered and the cursor is positioned at the Insert row. The columns in the Insert row should be filled in with the appropriate update methods, before calling insertRow to insert the new row into the database.

Throws

SQLException if a database error happens

public boolean next()

Shifts the cursor position down one row in this ResultSet object.

Any InputStreams associated with the current row are closed and any warnings are cleared.

Returns

  • true if the updated cursor position is pointing to a valid row, false otherwise (ie when the cursor is after the last row in the ResultSet).

Throws

SQLException if a database error happens

public boolean previous()

Relocates the cursor position to the preceding row in this ResultSet.

Returns

  • true if the new position is in a legitimate row, false if the cursor is now before the first row.

Throws

SQLException if a database error happens

public void refreshRow()

Refreshes the current row with its most up to date value in the database. Must not be called when the cursor is on the Insert row.

If any columns in the current row have been updated but the updateRow has not been called, then the updates are lost when this method is called.

Throws

SQLException if a database error happens, including if the current row is the Insert row.

public boolean relative(int rows)

Moves the cursor position up or down by a specified number of rows. If the new position is beyond the start or end rows, the cursor position is set before the first row/after the last row.

Parameters

rows a number of rows to move the cursor - may be positive or negative

Returns

  • true if the new cursor position is on a row, false otherwise

Throws

SQLException if a database error happens

public boolean rowDeleted()

Indicates whether a row has been deleted. This method depends on whether the JDBC driver and database can detect deletions.

Returns

  • true if a row has been deleted and if deletions are detected, false otherwise.

Throws

SQLException if a database error happens

public boolean rowInserted()

Indicates whether the current row has had an insertion operation. This method depends on whether the JDBC driver and database can detect insertions.

Returns

  • true if a row has been inserted and if insertions are detected, false otherwise.

Throws

SQLException if a database error happens

public boolean rowUpdated()

Indicates whether the current row has been updated. This method depends on whether the JDBC driver and database can detect updates.

Returns

  • true if the current row has been updated and if updates can be detected, false otherwise.

Throws

SQLException if a database error happens

public void setFetchDirection(int direction)

Indicates which direction (forward/reverse) will be used to process the rows of this ResultSet object. This is treated as a hint by the JDBC driver.

Parameters

direction can be ResultSet.FETCH_FORWARD, ResultSet.FETCH_REVERSE, or ResultSet.FETCH_UNKNOWN

Throws

SQLException if there is a database error

public void setFetchSize(int rows)

Indicates the amount of rows to fetch from the database when extra rows are required for this ResultSet. This used as a hint to the JDBC driver.

Parameters

rows the number of rows to fetch. 0 implies that the JDBC driver can make its own decision about the fetch size. The number should not be greater than the maximum number of rows established by the Statement that generated the ResultSet.

Throws

SQLException if a database error happens

public void updateArray(int columnIndex, Array x)

Updates a column specified by a column index with a java.sql.Array value.

Parameters

columnIndex the index of the column to update
x the new value for the specified column

Throws

SQLException if a database error happens

public void updateArray(String columnName, Array x)

Updates a column specified by a column name with a java.sql.Array value.

Parameters

columnName the name of the column to update
x the new value for the specified column

Throws

SQLException if a database error happens

public void updateAsciiStream(String columnName, InputStream x, int length)

Updates a column specified by a column name with an Ascii stream value.

Parameters

columnName the name of the column to update
x the new value for the specified column
length the length of the data to write from the stream

Throws

SQLException if a database error happens

public void updateAsciiStream(int columnIndex, InputStream x, int length)

Updates a column specified by a column index with an ASCII stream value.

Parameters

columnIndex the index of the column to update
x the new value for the specified column
length the length of the data to write from the stream

Throws

SQLException if a database error happens

public void updateBigDecimal(int columnIndex, BigDecimal x)

Updates a column specified by a column index with a java.sql.BigDecimal value.

Parameters

columnIndex the index of the column to update
x the new value for the specified column

Throws

SQLException if a database error happens

public void updateBigDecimal(String columnName, BigDecimal x)

Updates a column specified by a column name with a java.sql.BigDecimal value.

Parameters

columnName the name of the column to update
x the new value for the specified column

Throws

SQLException if a database error happens

public void updateBinaryStream(String columnName, InputStream x, int length)

Updates a column specified by a column name with a binary stream value.

Parameters

columnName the name of the column to update
x the new value for the specified column

Throws

SQLException if a database error happens

public void updateBinaryStream(int columnIndex, InputStream x, int length)

Updates a column specified by a column index with a binary stream value.

Parameters

columnIndex the index of the column to update
x the new value for the specified column

Throws

SQLException if a database error happens

public void updateBlob(int columnIndex, Blob x)

Updates a column specified by a column index with a java.sql.Blob value.

Parameters

columnIndex the index of the column to update
x the new value for the specified column

Throws

SQLException if a database error happens

public void updateBlob(String columnName, Blob x)

Updates a column specified by a column name with a java.sql.Blob value.

Parameters

columnName the name of the column to update
x the new value for the specified column

Throws

SQLException if a database error happens

public void updateBoolean(String columnName, boolean x)

Updates a column specified by a column name with a boolean value.

Parameters

columnName the name of the column to update
x the new value for the specified column

Throws

SQLException if a database error happens

public void updateBoolean(int columnIndex, boolean x)

Updates a column specified by a column index with a boolean value.

Parameters

x the new value for the specified column

Throws

SQLException if a database error happens

public void updateByte(String columnName, byte x)

Updates a column specified by a column name with a byte value.

Parameters

columnName the name of the column to update
x the new value for the specified column

Throws

SQLException if a database error happens

public void updateByte(int columnIndex, byte x)

Updates a column specified by a column index with a byte value.

Parameters

columnIndex the index of the column to update
x the new value for the specified column

Throws

SQLException if a database error happens

public void updateBytes(String columnName, byte[] x)

Updates a column specified by a column name with a byte array value.

Parameters

columnName the name of the column to update
x the new value for the specified column

Throws

SQLException if a database error happens

public void updateBytes(int columnIndex, byte[] x)

Updates a column specified by a column index with a byte array value.

Parameters

columnIndex the index of the column to update
x the new value for the specified column

Throws

SQLException if a database error happens

public void updateCharacterStream(int columnIndex, Reader x, int length)

Updates a column specified by a column index with a character stream value.

Parameters

columnIndex the index of the column to update
x the new value for the specified column
length the length of data to write from the stream

Throws

SQLException if a database error happens

public void updateCharacterStream(String columnName, Reader reader, int length)

Updates a column specified by a column name with a character stream value.

Parameters

columnName the name of the column to update
reader the new value for the specified column
length the length of data to write from the Reader

Throws

SQLException if a database error happens

public void updateClob(String columnName, Clob x)

Updates a column specified by a column name with a java.sql.Clob value.

Parameters

columnName the name of the column to update
x the new value for the specified column

Throws

SQLException if a database error happens

public void updateClob(int columnIndex, Clob x)

Updates a column specified by a column index with a java.sql.Clob value.

Parameters

columnIndex the index of the column to update
x the new value for the specified column

Throws

SQLException if a database error happens

public void updateDate(String columnName, Date x)

Updates a column specified by a column name with a java.sql.Date value.

Parameters

columnName the name of the column to update
x the new value for the specified column

Throws

SQLException if a database error happens

public void updateDate(int columnIndex, Date x)

Updates a column specified by a column index with a java.sql.Date value.

Parameters

columnIndex the index of the column to update
x the new value for the specified column

Throws

SQLException if a database error happens

public void updateDouble(int columnIndex, double x)

Updates a column specified by a column index with a double value.

Parameters

columnIndex the index of the column to update
x the new value for the specified column

Throws

SQLException if a database error happens

public void updateDouble(String columnName, double x)

Updates a column specified by a column name with a double value.

Parameters

columnName the name of the column to update
x the new value for the specified column

Throws

SQLException if a database error happens

public void updateFloat(int columnIndex, float x)

Updates a column specified by a column index with a float value.

Parameters

columnIndex the index of the column to update
x the new value for the specified column

Throws

SQLException if a database error happens

public void updateFloat(String columnName, float x)

Updates a column specified by a column name with a float value.

Parameters

columnName the name of the column to update
x the new value for the specified column

Throws

SQLException if a database error happens

public void updateInt(String columnName, int x)

Updates a column specified by a column name with an int value.

Parameters

columnName the name of the column to update
x the new value for the specified column

Throws

SQLException if a database error happens

public void updateInt(int columnIndex, int x)

Updates a column specified by a column index with an int value.

Parameters

columnIndex the index of the column to update
x the new value for the specified column

Throws

SQLException if a database error happens

public void updateLong(int columnIndex, long x)

Updates a column specified by a column index with a long value.

Parameters

columnIndex the index of the column to update
x the new value for the specified column

Throws

SQLException if a database error happens

public void updateLong(String columnName, long x)

Updates a column specified by a column name with a long value.

Parameters

columnName the name of the column to update
x the new value for the specified column

Throws

SQLException if a database error happens

public void updateNull(int columnIndex)

Updates a column specified by a column index with a null value.

Parameters

columnIndex the index of the column to update

Throws

SQLException if a database error happens

public void updateNull(String columnName)

Updates a column specified by a column name with a null value.

Parameters

columnName the name of the column to update

Throws

SQLException if a database error happens

public void updateObject(int columnIndex, Object x)

Updates a column specified by a column index with an Object value.

Parameters

columnIndex the index of the column to update
x the new value for the specified column

Throws

SQLException if a database error happens

public void updateObject(int columnIndex, Object x, int scale)

Updates a column specified by a column index with an Object value.

Parameters

columnIndex the index of the column to update
x the new value for the specified column
scale for the types java.sql.Types.DECIMAL or java.sql.Types.NUMERIC, this specifies the number of digits after the decimal point.

Throws

SQLException if a database error happens

public void updateObject(String columnName, Object x)

Updates a column specified by a column name with an Object value.

Parameters

columnName the name of the column to update
x the new value for the specified column

Throws

SQLException if a database error happens

public void updateObject(String columnName, Object x, int scale)

Updates a column specified by a column name with an Object value.

Parameters

columnName the name of the column to update
x the new value for the specified column
scale for the types java.sql.Types.DECIMAL or java.sql.Types.NUMERIC, this specifies the number of digits after the decimal point.

Throws

SQLException if a database error happens

public void updateRef(int columnIndex, Ref x)

Updates a column specified by a column index with a java.sql.Ref value.

Parameters

columnIndex the index of the column to update
x the new value for the specified column

Throws

SQLException if a database error happens

public void updateRef(String columnName, Ref x)

Updates a column specified by a column name with a java.sql.Ref value.

Parameters

columnName the name of the column to update
x the new value for the specified column

Throws

SQLException if a database error happens

public void updateRow()

Updates the database with the new contents of the current row of this ResultSet object.

Throws

SQLException

public void updateShort(String columnName, short x)

Updates a column specified by a column name with a short value.

Parameters

columnName the name of the column to update
x the new value for the specified column

Throws

SQLException if a database error happens

public void updateShort(int columnIndex, short x)

Updates a column specified by a column index with a short value.

Parameters

columnIndex the index of the column to update
x the new value for the specified column

Throws

SQLException if a database error happens

public void updateString(String columnName, String x)

Updates a column specified by a column name with a String value.

Parameters

columnName the name of the column to update
x the new value for the specified column

Throws

SQLException if a database error happens

public void updateString(int columnIndex, String x)

Updates a column specified by a column index with a String value.

Parameters

columnIndex the index of the column to update
x the new value for the specified column

Throws

SQLException if a database error happens

public void updateTime(int columnIndex, Time x)

Updates a column specified by a column index with a Time value.

Parameters

columnIndex the index of the column to update
x the new value for the specified column

Throws

SQLException if a database error happens

public void updateTime(String columnName, Time x)

Updates a column specified by a column name with a Time value.

Parameters

x the new value for the specified column

Throws

SQLException if a database error happens

public void updateTimestamp(int columnIndex, Timestamp x)

Updates a column specified by a column index with a Timestamp value.

Parameters

columnIndex the index of the column to update
x the new value for the specified column

Throws

SQLException if a database error happens

public void updateTimestamp(String columnName, Timestamp x)

Updates a column specified by column name with a Timestamp value.

Parameters

columnName the name of the column to update

Throws

SQLException if a database error happens

public boolean wasNull()

Determines if the last column read from this ResultSet contained SQL NULL.

Returns

  • true if the last column contained SQL NULL, false otherwise

Throws

SQLException if a database error happens
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:48