java.sql

Interface ResultSet

public interface ResultSet

This interface provides access to the data set returned by a SQL statement. An instance of this interface is returned by the various execution methods in the Statement.

This class models a cursor, which can be stepped through one row at a time. Methods are provided for accessing columns by column name or by index.

Note that a result set is invalidated if the statement that returned it is closed.

Field Summary
intCLOSE_CURSORS_AT_COMMIT
intCONCUR_READ_ONLY
The concurrency mode of for the result set may not be modified.
intCONCUR_UPDATABLE
The concurrency mode of for the result set may be modified.
intFETCH_FORWARD
The rows will be processed in order from first to last.
intFETCH_REVERSE
The rows will be processed in order from last to first.
intFETCH_UNKNOWN
The rows will be processed in an unknown order
intHOLD_CURSORS_OVER_COMMIT
intTYPE_FORWARD_ONLY
This type of result set may only step forward through the rows returned.
intTYPE_SCROLL_INSENSITIVE
This type of result set is scrollable and is not sensitive to changes made by other statements.
intTYPE_SCROLL_SENSITIVE
This type of result set is scrollable and is also sensitive to changes made by other statements.
Method Summary
booleanabsolute(int row)
This method positions the result set to the specified absolute row.
voidafterLast()
This method repositions the cursor to after the last row in the result set.
voidbeforeFirst()
This method repositions the cursor to before the first row in the result set.
voidcancelRowUpdates()
This method cancels any changes that have been made to a row.
voidclearWarnings()
This method clears all warnings associated with this result set.
voidclose()
This method closes the result set and frees any associated resources.
voiddeleteRow()
This method deletes the current row in the database.
intfindColumn(String columnName)
This method returns the column index of the specified named column.
booleanfirst()
This method repositions the cursor on the first row in the result set.
ArraygetArray(int columnIndex)
This method returns the specified column value as an Array.
ArraygetArray(String columnName)
This method returns the specified column value as an Array.
InputStreamgetAsciiStream(int columnIndex)
This method returns the value of the specified column as an ASCII stream.
InputStreamgetAsciiStream(String columnName)
This method returns the value of the specified column as an ASCII stream.
BigDecimalgetBigDecimal(int columnIndex, int scale)
This method returns the value of the specified column as a Java BigDecimal.
BigDecimalgetBigDecimal(String columnName, int scale)
This method returns the value of the specified column as a Java BigDecimal.
BigDecimalgetBigDecimal(int columnIndex)
This method returns the value of the specified column as a Java BigDecimal.
BigDecimalgetBigDecimal(String columnName)
This method returns the value of the specified column as a Java BigDecimal.
InputStreamgetBinaryStream(int columnIndex)
This method returns the value of the specified column as a raw byte stream.
InputStreamgetBinaryStream(String columnName)
This method returns the value of the specified column as a raw byte stream.
BlobgetBlob(int columnIndex)
This method returns the specified column value as a BLOB.
BlobgetBlob(String columnName)
This method returns the specified column value as a BLOB.
booleangetBoolean(int columnIndex)
This method returns the value of the specified column as a Java boolean.
booleangetBoolean(String columnName)
This method returns the value of the specified column as a Java boolean.
bytegetByte(int columnIndex)
This method returns the value of the specified column as a Java byte.
bytegetByte(String columnName)
This method returns the value of the specified column as a Java byte.
byte[]getBytes(int columnIndex)
This method returns the value of the specified column as a Java byte array.
byte[]getBytes(String columnName)
This method returns the value of the specified column as a Java byte array.
ReadergetCharacterStream(int columnIndex)
This method returns the value of the specified column as a character stream.
ReadergetCharacterStream(String columnName)
This method returns the value of the specified column as a character stream.
ClobgetClob(int columnIndex)
This method returns the specified column value as a CLOB.
ClobgetClob(String columnName)
This method returns the specified column value as a CLOB.
intgetConcurrency()
This method returns the concurrency type of this result set.
StringgetCursorName()
This method returns the name of the database cursor used by this result set.
DategetDate(int columnIndex)
This method returns the value of the specified column as a Java java.sql.Date.
DategetDate(String columnName)
This method returns the value of the specified column as a Java java.sql.Date.
DategetDate(int columnIndex, Calendar cal)
This method returns the specified column value as a java.sql.Date.
DategetDate(String columnName, Calendar cal)
This method returns the specified column value as a java.sql.Date.
doublegetDouble(int columnIndex)
This method returns the value of the specified column as a Java double.
doublegetDouble(String columnName)
This method returns the value of the specified column as a Java double.
intgetFetchDirection()
This method returns the current fetch direction for this result set.
intgetFetchSize()
This method returns the current number of rows that will be fetched from the database at a time.
floatgetFloat(int columnIndex)
This method returns the value of the specified column as a Java float.
floatgetFloat(String columnName)
This method returns the value of the specified column as a Java float.
intgetInt(int columnIndex)
This method returns the value of the specified column as a Java int.
intgetInt(String columnName)
This method returns the value of the specified column as a Java int.
longgetLong(int columnIndex)
This method returns the value of the specified column as a Java long.
longgetLong(String columnName)
This method returns the value of the specified column as a Java long.
ResultSetMetaDatagetMetaData()
This method returns data about the columns returned as part of the result set as a ResultSetMetaData instance.
ObjectgetObject(int columnIndex)
This method returns the value of the specified column as a Java Object.
ObjectgetObject(String columnName)
This method returns the value of the specified column as a Java Object.
ObjectgetObject(int columnIndex, Map<String,Class<?>> map)
This method returns the value of the specified column as a Java Object using the specified SQL type to Java type map.
ObjectgetObject(String columnName, Map<String,Class<?>> map)
This method returns the value of the specified column as a Java Object using the specified SQL type to Java type map.
RefgetRef(int columnIndex)
This method returns a Ref for the specified column which represents the structured type for the column.
RefgetRef(String columnName)
This method returns a Ref for the specified column which represents the structured type for the column.
intgetRow()
This method returns the current row number in the cursor.
shortgetShort(int columnIndex)
This method returns the value of the specified column as a Java short.
shortgetShort(String columnName)
This method returns the value of the specified column as a Java short.
StatementgetStatement()
This method returns a the Statement that was used to produce this result set.
StringgetString(int columnIndex)
This method returns the value of the specified column as a Java String.
StringgetString(String columnName)
This method returns the value of the specified column as a Java String.
TimegetTime(int columnIndex)
This method returns the value of the specified column as a Java java.sql.Time.
TimegetTime(String columnName)
This method returns the value of the specified column as a Java java.sql.Time.
TimegetTime(int columnIndex, Calendar cal)
This method returns the specified column value as a java.sql.Time.
TimegetTime(String columnName, Calendar cal)
This method returns the specified column value as a java.sql.Time.
TimestampgetTimestamp(int columnIndex)
This method returns the value of the specified column as a Java java.sql.Timestamp.
TimestampgetTimestamp(String columnName)
This method returns the value of the specified column as a Java java.sql.Timestamp.
TimestampgetTimestamp(int columnIndex, Calendar cal)
This method returns the specified column value as a java.sql.Timestamp.
TimestampgetTimestamp(String columnName, Calendar cal)
This method returns the specified column value as a java.sql.Timestamp.
intgetType()
This method returns the result set type of this result set.
InputStreamgetUnicodeStream(int columnIndex)
This method returns the value of the specified column as a Unicode UTF-8 stream.
InputStreamgetUnicodeStream(String columnName)
This method returns the value of the specified column as a Unicode UTF-8 stream.
URLgetURL(int columnIndex)
This method returns the specified column value as a java.net.URL.
URLgetURL(String columnName)
This method returns the specified column value as a java.net.URL.
SQLWarninggetWarnings()
This method returns the first SQL warning associated with this result set.
voidinsertRow()
This method inserts the current row into the database.
booleanisAfterLast()
This method tests whether or not the cursor is after the last row in the result set.
booleanisBeforeFirst()
This method tests whether or not the cursor is before the first row in the result set.
booleanisFirst()
This method tests whether or not the cursor is positioned on the first row in the result set.
booleanisLast()
This method tests whether or not the cursor is on the last row in the result set.
booleanlast()
This method repositions the cursor on the last row in the result set.
voidmoveToCurrentRow()
This method moves the result set position from the insert row back to the current row that was selected prior to moving to the insert row.
voidmoveToInsertRow()
This method positions the result set to the "insert row", which allows a new row to be inserted into the database from the result set.
booleannext()
This method advances to the next row in the result set.
booleanprevious()
This method moves the current position to the previous row in the result set.
voidrefreshRow()
This method refreshes the contents of the current row from the database.
booleanrelative(int rows)
This method moves the result set position relative to the current row.
booleanrowDeleted()
This method tests whether or not the current row in the result set has been deleted.
booleanrowInserted()
This method tests whether or not the current row in the result set has been inserted.
booleanrowUpdated()
This method tests whether or not the current row in the result set has been updated.
voidsetFetchDirection(int direction)
This method provides a hint to the driver about which direction the result set will be processed in.
voidsetFetchSize(int rows)
This method provides a hint to the driver about how many rows at a time it should fetch from the database.
voidupdateArray(int columnIndex, Array value)
This method updates the specified column to have a java.sqlArray value.
voidupdateArray(String columnName, Array value)
This method updates the specified column to have a java.sqlArray value.
voidupdateAsciiStream(int columnIndex, InputStream stream, int count)
This method updates the specified column from an ASCII text stream.
voidupdateAsciiStream(String columnName, InputStream stream, int count)
This method updates the specified column from an ASCII text stream.
voidupdateBigDecimal(int columnIndex, BigDecimal value)
This method updates the specified column to have a BigDecimal value.
voidupdateBigDecimal(String columnName, BigDecimal value)
This method updates the specified column to have a BigDecimal value.
voidupdateBinaryStream(int columnIndex, InputStream stream, int count)
This method updates the specified column from a binary stream.
voidupdateBinaryStream(String columnName, InputStream stream, int count)
This method updates the specified column from a binary stream.
voidupdateBlob(int columnIndex, Blob value)
This method updates the specified column to have a java.sql.Blob value.
voidupdateBlob(String columnName, Blob value)
This method updates the specified column to have a java.sql.Blob value.
voidupdateBoolean(int columnIndex, boolean value)
This method updates the specified column to have a boolean value.
voidupdateBoolean(String columnName, boolean value)
This method updates the specified column to have a boolean value.
voidupdateByte(int columnIndex, byte value)
This method updates the specified column to have a byte value.
voidupdateByte(String columnName, byte value)
This method updates the specified column to have a byte value.
voidupdateBytes(int columnIndex, byte[] value)
This method updates the specified column to have a byte array value.
voidupdateBytes(String columnName, byte[] value)
This method updates the specified column to have a byte array value.
voidupdateCharacterStream(int columnIndex, Reader reader, int count)
This method updates the specified column from a character stream.
voidupdateCharacterStream(String columnName, Reader reader, int count)
This method updates the specified column from a character stream.
voidupdateClob(int columnIndex, Clob value)
This method updates the specified column to have a java.sql.Clob value.
voidupdateClob(String columnName, Clob value)
This method updates the specified column to have a java.sql.Clob value.
voidupdateDate(int columnIndex, Date value)
This method updates the specified column to have a java.sql.Date value.
voidupdateDate(String columnName, Date value)
This method updates the specified column to have a java.sql.Date value.
voidupdateDouble(int columnIndex, double value)
This method updates the specified column to have a double value.
voidupdateDouble(String columnName, double value)
This method updates the specified column to have a double value.
voidupdateFloat(int columnIndex, float value)
This method updates the specified column to have a float value.
voidupdateFloat(String columnName, float value)
This method updates the specified column to have a float value.
voidupdateInt(int columnIndex, int value)
This method updates the specified column to have an int value.
voidupdateInt(String columnName, int value)
This method updates the specified column to have an int value.
voidupdateLong(int columnIndex, long value)
This method updates the specified column to have a long value.
voidupdateLong(String columnName, long value)
This method updates the specified column to have a long value.
voidupdateNull(int columnIndex)
This method updates the specified column to have a NULL value.
voidupdateNull(String columnName)
This method updates the specified column to have a NULL value.
voidupdateObject(int columnIndex, Object value, int scale)
This method updates the specified column to have an Object value.
voidupdateObject(int columnIndex, Object value)
This method updates the specified column to have an Object value.
voidupdateObject(String columnName, Object value, int scale)
This method updates the specified column to have an Object value.
voidupdateObject(String columnName, Object value)
This method updates the specified column to have an Object value.
voidupdateRef(int columnIndex, Ref value)
This method updates the specified column to have a java.sql.Ref value.
voidupdateRef(String columnName, Ref value)
This method updates the specified column to have a java.sql.Ref value.
voidupdateRow()
This method updates the current row in the database.
voidupdateShort(int columnIndex, short value)
This method updates the specified column to have a short value.
voidupdateShort(String columnName, short value)
This method updates the specified column to have a short value.
voidupdateString(int columnIndex, String value)
This method updates the specified column to have a String value.
voidupdateString(String columnName, String value)
This method updates the specified column to have a String value.
voidupdateTime(int columnIndex, Time value)
This method updates the specified column to have a java.sql.Time value.
voidupdateTime(String columnName, Time value)
This method updates the specified column to have a java.sql.Time value.
voidupdateTimestamp(int columnIndex, Timestamp value)
This method updates the specified column to have a java.sql.Timestamp value.
voidupdateTimestamp(String columnName, Timestamp value)
This method updates the specified column to have a java.sql.Timestamp value.
booleanwasNull()
This method tests whether the value of the last column that was fetched was actually a SQL NULL value.

Field Detail

CLOSE_CURSORS_AT_COMMIT

public int CLOSE_CURSORS_AT_COMMIT

CONCUR_READ_ONLY

public int CONCUR_READ_ONLY
The concurrency mode of for the result set may not be modified.

CONCUR_UPDATABLE

public int CONCUR_UPDATABLE
The concurrency mode of for the result set may be modified.

FETCH_FORWARD

public int FETCH_FORWARD
The rows will be processed in order from first to last.

FETCH_REVERSE

public int FETCH_REVERSE
The rows will be processed in order from last to first.

FETCH_UNKNOWN

public int FETCH_UNKNOWN
The rows will be processed in an unknown order

HOLD_CURSORS_OVER_COMMIT

public int HOLD_CURSORS_OVER_COMMIT

TYPE_FORWARD_ONLY

public int TYPE_FORWARD_ONLY
This type of result set may only step forward through the rows returned.

TYPE_SCROLL_INSENSITIVE

public int TYPE_SCROLL_INSENSITIVE
This type of result set is scrollable and is not sensitive to changes made by other statements.

TYPE_SCROLL_SENSITIVE

public int TYPE_SCROLL_SENSITIVE
This type of result set is scrollable and is also sensitive to changes made by other statements.

Method Detail

absolute

public boolean absolute(int row)
This method positions the result set to the specified absolute row. Positive numbers are row offsets from the beginning of the result set (numbering starts from row 1) and negative numbers are row offsets from the end of the result set (numbering starts from -1).

Parameters: row The row to position the result set to.

Returns: true if the current position was changed, false otherwise.

Throws: SQLException If an error occurs.

afterLast

public void afterLast()
This method repositions the cursor to after the last row in the result set.

Throws: SQLException If an error occurs.

beforeFirst

public void beforeFirst()
This method repositions the cursor to before the first row in the result set.

Throws: SQLException If an error occurs.

cancelRowUpdates

public void cancelRowUpdates()
This method cancels any changes that have been made to a row. If the rowUpdate method has been called, then the changes cannot be undone.

Throws: SQLException If an error occurs.

clearWarnings

public void clearWarnings()
This method clears all warnings associated with this result set.

Throws: SQLException If an error occurs.

close

public void close()
This method closes the result set and frees any associated resources.

Throws: SQLException If an error occurs.

deleteRow

public void deleteRow()
This method deletes the current row in the database.

Throws: SQLException If an error occurs.

findColumn

public int findColumn(String columnName)
This method returns the column index of the specified named column.

Parameters: columnName The name of the column.

Returns: The index of the column.

Throws: SQLException If an error occurs.

first

public boolean first()
This method repositions the cursor on the first row in the result set.

Returns: true if the cursor is on a valid row; false if there are no rows in the result set.

Throws: SQLException If an error occurs.

getArray

public Array getArray(int columnIndex)
This method returns the specified column value as an Array.

Parameters: columnIndex The index of the column value to return.

Returns: The value of the column as an Array.

Throws: SQLException If an error occurs.

getArray

public Array getArray(String columnName)
This method returns the specified column value as an Array.

Parameters: columnName The name of the column value to return.

Returns: The value of the column as an Array.

Throws: SQLException If an error occurs.

getAsciiStream

public InputStream getAsciiStream(int columnIndex)
This method returns the value of the specified column as an ASCII stream. Note that all the data from this stream must be read before fetching the value of any other column. Please also be aware that calling next() or close() on this result set will close this stream as well.

Parameters: columnIndex The index of the column to return.

Returns: The column value as an ASCII InputStream.

Throws: SQLException If an error occurs.

getAsciiStream

public InputStream getAsciiStream(String columnName)
This method returns the value of the specified column as an ASCII stream. Note that all the data from this stream must be read before fetching the value of any other column. Please also be aware that calling next() or close() on this result set will close this stream as well.

Parameters: columnName The name of the column to return.

Returns: The column value as an ASCII InputStream.

Throws: SQLException If an error occurs.

getBigDecimal

public BigDecimal getBigDecimal(int columnIndex, int scale)

Deprecated:

This method returns the value of the specified column as a Java BigDecimal.

Parameters: columnIndex The index of the column to return. scale The number of digits to the right of the decimal to return.

Returns: The column value as a BigDecimal.

Throws: SQLException If an error occurs.

getBigDecimal

public BigDecimal getBigDecimal(String columnName, int scale)

Deprecated:

This method returns the value of the specified column as a Java BigDecimal.

Parameters: columnName The name of the column to return.

Returns: The column value as a BigDecimal.

Throws: SQLException If an error occurs.

getBigDecimal

public BigDecimal getBigDecimal(int columnIndex)
This method returns the value of the specified column as a Java BigDecimal.

Parameters: columnIndex The index of the column to return.

Returns: The column value as a BigDecimal.

Throws: SQLException If an error occurs.

getBigDecimal

public BigDecimal getBigDecimal(String columnName)
This method returns the value of the specified column as a Java BigDecimal.

Parameters: columnName The name of the column to return.

Returns: The column value as a BigDecimal.

Throws: SQLException If an error occurs.

getBinaryStream

public InputStream getBinaryStream(int columnIndex)
This method returns the value of the specified column as a raw byte stream. Note that all the data from this stream must be read before fetching the value of any other column. Please also be aware that calling next() or close() on this result set will close this stream as well.

Parameters: columnIndex The index of the column to return.

Returns: The column value as a raw byte InputStream.

Throws: SQLException If an error occurs.

getBinaryStream

public InputStream getBinaryStream(String columnName)
This method returns the value of the specified column as a raw byte stream. Note that all the data from this stream must be read before fetching the value of any other column. Please also be aware that calling next() or close() on this result set will close this stream as well.

Parameters: columnName The name of the column to return.

Returns: The column value as a raw byte InputStream.

Throws: SQLException If an error occurs.

getBlob

public Blob getBlob(int columnIndex)
This method returns the specified column value as a BLOB.

Parameters: columnIndex The index of the column value to return.

Returns: The value of the column as a BLOB.

Throws: SQLException If an error occurs.

getBlob

public Blob getBlob(String columnName)
This method returns the specified column value as a BLOB.

Parameters: columnName The name of the column value to return.

Returns: The value of the column as a BLOB.

Throws: SQLException If an error occurs.

getBoolean

public boolean getBoolean(int columnIndex)
This method returns the value of the specified column as a Java boolean.

Parameters: columnIndex The index of the column to return.

Returns: The column value as a boolean.

Throws: SQLException If an error occurs.

getBoolean

public boolean getBoolean(String columnName)
This method returns the value of the specified column as a Java boolean.

Parameters: columnName The name of the column to return.

Returns: The column value as a boolean.

Throws: SQLException If an error occurs.

getByte

public byte getByte(int columnIndex)
This method returns the value of the specified column as a Java byte.

Parameters: columnIndex The index of the column to return.

Returns: The column value as a byte.

Throws: SQLException If an error occurs.

getByte

public byte getByte(String columnName)
This method returns the value of the specified column as a Java byte.

Parameters: columnName The name of the column to return.

Returns: The column value as a byte.

Throws: SQLException If an error occurs.

getBytes

public byte[] getBytes(int columnIndex)
This method returns the value of the specified column as a Java byte array.

Parameters: columnIndex The index of the column to return.

Returns: The column value as a byte array

Throws: SQLException If an error occurs.

getBytes

public byte[] getBytes(String columnName)
This method returns the value of the specified column as a Java byte array.

Parameters: columnName The name of the column to return.

Returns: The column value as a byte array

Throws: SQLException If an error occurs.

getCharacterStream

public Reader getCharacterStream(int columnIndex)
This method returns the value of the specified column as a character stream. Note that all the data from this stream must be read before fetching the value of any other column. Please also be aware that calling next() or close() on this result set will close this stream as well.

Parameters: columnIndex The index of the column to return.

Returns: The column value as an character Reader.

Throws: SQLException If an error occurs.

getCharacterStream

public Reader getCharacterStream(String columnName)
This method returns the value of the specified column as a character stream. Note that all the data from this stream must be read before fetching the value of any other column. Please also be aware that calling next() or close() on this result set will close this stream as well.

Parameters: columnName The name of the column to return.

Returns: The column value as an character Reader.

Throws: SQLException If an error occurs.

getClob

public Clob getClob(int columnIndex)
This method returns the specified column value as a CLOB.

Parameters: columnIndex The index of the column value to return.

Returns: The value of the column as a CLOB.

Throws: SQLException If an error occurs.

getClob

public Clob getClob(String columnName)
This method returns the specified column value as a CLOB.

Parameters: columnName The name of the column value to return.

Returns: The value of the column as a CLOB.

Throws: SQLException If an error occurs.

getConcurrency

public int getConcurrency()
This method returns the concurrency type of this result set. This will be one of the CONCUR_* constants defined in this interface.

Returns: The result set concurrency type.

Throws: SQLException If an error occurs.

getCursorName

public String getCursorName()
This method returns the name of the database cursor used by this result set.

Returns: The name of the database cursor used by this result set.

Throws: SQLException If an error occurs.

getDate

public Date getDate(int columnIndex)
This method returns the value of the specified column as a Java java.sql.Date.

Parameters: columnIndex The index of the column to return.

Returns: The column value as a java.sql.Date.

Throws: SQLException If an error occurs.

getDate

public Date getDate(String columnName)
This method returns the value of the specified column as a Java java.sql.Date.

Parameters: columnName The name of the column to return.

Returns: The column value as a java.sql.Date.

Throws: SQLException If an error occurs.

getDate

public Date getDate(int columnIndex, Calendar cal)
This method returns the specified column value as a java.sql.Date. The specified Calendar is used to generate a value for the date if the database does not support timezones.

Parameters: columnIndex The index of the column value to return. cal The Calendar to use for calculating timezones.

Returns: The value of the column as a java.sql.Date.

Throws: SQLException If an error occurs.

getDate

public Date getDate(String columnName, Calendar cal)
This method returns the specified column value as a java.sql.Date. The specified Calendar is used to generate a value for the date if the database does not support timezones.

Parameters: columnName The name of the column value to return. cal The Calendar to use for calculating timezones.

Returns: The value of the column as a java.sql.Date.

Throws: SQLException If an error occurs.

getDouble

public double getDouble(int columnIndex)
This method returns the value of the specified column as a Java double.

Parameters: columnIndex The index of the column to return.

Returns: The column value as a double.

Throws: SQLException If an error occurs.

getDouble

public double getDouble(String columnName)
This method returns the value of the specified column as a Java double.

Parameters: columnName The name of the column to return.

Returns: The column value as a double.

Throws: SQLException If an error occurs.

getFetchDirection

public int getFetchDirection()
This method returns the current fetch direction for this result set.

Returns: The fetch direction for this result set.

Throws: SQLException If an error occurs.

getFetchSize

public int getFetchSize()
This method returns the current number of rows that will be fetched from the database at a time.

Returns: The current fetch size for this result set.

Throws: SQLException If an error occurs.

getFloat

public float getFloat(int columnIndex)
This method returns the value of the specified column as a Java float.

Parameters: columnIndex The index of the column to return.

Returns: The column value as a float.

Throws: SQLException If an error occurs.

getFloat

public float getFloat(String columnName)
This method returns the value of the specified column as a Java float.

Parameters: columnName The name of the column to return.

Returns: The column value as a float.

Throws: SQLException If an error occurs.

getInt

public int getInt(int columnIndex)
This method returns the value of the specified column as a Java int.

Parameters: columnIndex The index of the column to return.

Returns: The column value as a int.

Throws: SQLException If an error occurs.

getInt

public int getInt(String columnName)
This method returns the value of the specified column as a Java int.

Parameters: columnName The name of the column to return.

Returns: The column value as a int.

Throws: SQLException If an error occurs.

getLong

public long getLong(int columnIndex)
This method returns the value of the specified column as a Java long.

Parameters: columnIndex The index of the column to return.

Returns: The column value as a long.

Throws: SQLException If an error occurs.

getLong

public long getLong(String columnName)
This method returns the value of the specified column as a Java long.

Parameters: columnName The name of the column to return.

Returns: The column value as a long.

Throws: SQLException If an error occurs.

getMetaData

public ResultSetMetaData getMetaData()
This method returns data about the columns returned as part of the result set as a ResultSetMetaData instance.

Returns: The ResultSetMetaData instance for this result set.

Throws: SQLException If an error occurs.

getObject

public Object getObject(int columnIndex)
This method returns the value of the specified column as a Java Object.

Parameters: columnIndex The index of the column to return.

Returns: The column value as an Object.

Throws: SQLException If an error occurs.

getObject

public Object getObject(String columnName)
This method returns the value of the specified column as a Java Object.

Parameters: columnName The name of the column to return.

Returns: The column value as an Object.

Throws: SQLException If an error occurs.

getObject

public Object getObject(int columnIndex, Map<String,Class<?>> map)
This method returns the value of the specified column as a Java Object using the specified SQL type to Java type map.

Parameters: columnIndex The index of the column to return. map The SQL type to Java type map to use.

Returns: The value of the column as an Object.

Throws: SQLException If an error occurs.

getObject

public Object getObject(String columnName, Map<String,Class<?>> map)
This method returns the value of the specified column as a Java Object using the specified SQL type to Java type map.

Parameters: columnName The name of the column to return. map The SQL type to Java type map to use.

Returns: The value of the column as an Object.

Throws: SQLException If an error occurs.

getRef

public Ref getRef(int columnIndex)
This method returns a Ref for the specified column which represents the structured type for the column.

Parameters: columnIndex The index of the column to return.

Returns: A Ref object for the column

Throws: SQLException If an error occurs.

getRef

public Ref getRef(String columnName)
This method returns a Ref for the specified column which represents the structured type for the column.

Parameters: columnName The name of the column to return.

Returns: A Ref object for the column

Throws: SQLException If an error occurs.

getRow

public int getRow()
This method returns the current row number in the cursor. Numbering begins at index 1.

Returns: The current row number, or 0 if there is not current row.

Throws: SQLException If an error occurs.

getShort

public short getShort(int columnIndex)
This method returns the value of the specified column as a Java short.

Parameters: columnIndex The index of the column to return.

Returns: The column value as a short.

Throws: SQLException If an error occurs.

getShort

public short getShort(String columnName)
This method returns the value of the specified column as a Java short.

Parameters: columnName The name of the column to return.

Returns: The column value as a short.

Throws: SQLException If an error occurs.

getStatement

public Statement getStatement()
This method returns a the Statement that was used to produce this result set.

Returns: The Statement used to produce this result set.

Throws: SQLException If an error occurs.

getString

public String getString(int columnIndex)
This method returns the value of the specified column as a Java String.

Parameters: columnIndex The index of the column to return.

Returns: The column value as a String.

Throws: SQLException If an error occurs.

getString

public String getString(String columnName)
This method returns the value of the specified column as a Java String.

Parameters: columnName The name of the column to return.

Returns: The column value as a String.

Throws: SQLException If an error occurs.

getTime

public Time getTime(int columnIndex)
This method returns the value of the specified column as a Java java.sql.Time.

Parameters: columnIndex The index of the column to return.

Returns: The column value as a java.sql.Time.

Throws: SQLException If an error occurs.

getTime

public Time getTime(String columnName)
This method returns the value of the specified column as a Java java.sql.Time.

Parameters: columnName The name of the column to return.

Returns: The column value as a java.sql.Time.

Throws: SQLException If an error occurs.

getTime

public Time getTime(int columnIndex, Calendar cal)
This method returns the specified column value as a java.sql.Time. The specified Calendar is used to generate a value for the time if the database does not support timezones.

Parameters: columnIndex The index of the column value to return. cal The Calendar to use for calculating timezones.

Returns: The value of the column as a java.sql.Time.

Throws: SQLException If an error occurs.

getTime

public Time getTime(String columnName, Calendar cal)
This method returns the specified column value as a java.sql.Time. The specified Calendar is used to generate a value for the time if the database does not support timezones.

Parameters: columnName The name of the column value to return. cal The Calendar to use for calculating timezones.

Returns: The value of the column as a java.sql.Time.

Throws: SQLException If an error occurs.

getTimestamp

public Timestamp getTimestamp(int columnIndex)
This method returns the value of the specified column as a Java java.sql.Timestamp.

Parameters: columnIndex The index of the column to return.

Returns: The column value as a java.sql.Timestamp.

Throws: SQLException If an error occurs.

getTimestamp

public Timestamp getTimestamp(String columnName)
This method returns the value of the specified column as a Java java.sql.Timestamp.

Parameters: columnName The name of the column to return.

Returns: The column value as a java.sql.Timestamp.

Throws: SQLException If an error occurs.

getTimestamp

public Timestamp getTimestamp(int columnIndex, Calendar cal)
This method returns the specified column value as a java.sql.Timestamp. The specified Calendar is used to generate a value for the timestamp if the database does not support timezones.

Parameters: columnIndex The index of the column value to return. cal The Calendar to use for calculating timezones.

Returns: The value of the column as a java.sql.Timestamp.

Throws: SQLException If an error occurs.

getTimestamp

public Timestamp getTimestamp(String columnName, Calendar cal)
This method returns the specified column value as a java.sql.Timestamp. The specified Calendar is used to generate a value for the timestamp if the database does not support timezones.

Parameters: columnName The name of the column value to return. cal The Calendar to use for calculating timezones.

Returns: The value of the column as a java.sql.Timestamp.

Throws: SQLException If an error occurs.

getType

public int getType()
This method returns the result set type of this result set. This will be one of the TYPE_* constants defined in this interface.

Returns: The result set type.

Throws: SQLException If an error occurs.

getUnicodeStream

public InputStream getUnicodeStream(int columnIndex)

Deprecated: Use getCharacterStream instead.

This method returns the value of the specified column as a Unicode UTF-8 stream. Note that all the data from this stream must be read before fetching the value of any other column. Please also be aware that calling next() or close() on this result set will close this stream as well.

Parameters: columnIndex The index of the column to return.

Returns: The column value as a Unicode UTF-8 InputStream.

Throws: SQLException If an error occurs.

getUnicodeStream

public InputStream getUnicodeStream(String columnName)

Deprecated: Use getCharacterStream instead.

This method returns the value of the specified column as a Unicode UTF-8 stream. Note that all the data from this stream must be read before fetching the value of any other column. Please also be aware that calling next() or close() on this result set will close this stream as well.

Parameters: columnName The name of the column to return.

Returns: The column value as a Unicode UTF-8 InputStream.

Throws: SQLException If an error occurs.

getURL

public URL getURL(int columnIndex)
This method returns the specified column value as a java.net.URL.

Parameters: columnIndex The index of the column value to return.

Throws: SQLException If an error occurs.

Since: 1.4

getURL

public URL getURL(String columnName)
This method returns the specified column value as a java.net.URL.

Parameters: columnName The name of the column value to return.

Throws: SQLException If an error occurs.

Since: 1.4

getWarnings

public SQLWarning getWarnings()
This method returns the first SQL warning associated with this result set. Any additional warnings will be chained to this one.

Returns: The first SQLWarning for this result set, or null if there are no warnings.

Throws: SQLException If an error occurs.

insertRow

public void insertRow()
This method inserts the current row into the database. The result set must be positioned on the insert row in order to call this method successfully.

Throws: SQLException If an error occurs.

isAfterLast

public boolean isAfterLast()
This method tests whether or not the cursor is after the last row in the result set.

Returns: true if the cursor is positioned after the last row, false otherwise.

Throws: SQLException If an error occurs.

isBeforeFirst

public boolean isBeforeFirst()
This method tests whether or not the cursor is before the first row in the result set.

Returns: true if the cursor is positioned before the first row, false otherwise.

Throws: SQLException If an error occurs.

isFirst

public boolean isFirst()
This method tests whether or not the cursor is positioned on the first row in the result set.

Returns: true if the cursor is positioned on the first row, false otherwise.

Throws: SQLException If an error occurs.

isLast

public boolean isLast()
This method tests whether or not the cursor is on the last row in the result set.

Returns: true if the cursor is positioned on the last row, false otherwise.

Throws: SQLException If an error occurs.

last

public boolean last()
This method repositions the cursor on the last row in the result set.

Returns: true if the cursor is on a valid row; false if there are no rows in the result set.

Throws: SQLException If an error occurs.

moveToCurrentRow

public void moveToCurrentRow()
This method moves the result set position from the insert row back to the current row that was selected prior to moving to the insert row.

Throws: SQLException If an error occurs.

moveToInsertRow

public void moveToInsertRow()
This method positions the result set to the "insert row", which allows a new row to be inserted into the database from the result set.

Throws: SQLException If an error occurs.

next

public boolean next()
This method advances to the next row in the result set. Any streams open on the current row are closed automatically.

Returns: true if the next row exists, false otherwise.

Throws: SQLException If an error occurs.

previous

public boolean previous()
This method moves the current position to the previous row in the result set.

Returns: true if the previous row exists, false otherwise.

Throws: SQLException If an error occurs.

refreshRow

public void refreshRow()
This method refreshes the contents of the current row from the database.

Throws: SQLException If an error occurs.

relative

public boolean relative(int rows)
This method moves the result set position relative to the current row. The offset can be positive or negative.

Parameters: rows The number of row positions to move.

Returns: true if the current position was changed, false otherwise.

Throws: SQLException If an error occurs.

rowDeleted

public boolean rowDeleted()
This method tests whether or not the current row in the result set has been deleted. Deletes must be visible in order of this method to detect the deletion.

Returns: true if the row has been deleted, false otherwise.

Throws: SQLException If an error occurs.

rowInserted

public boolean rowInserted()
This method tests whether or not the current row in the result set has been inserted. Inserts must be visible in order of this method to detect the insert.

Returns: true if the row has been inserted, false otherwise.

Throws: SQLException If an error occurs.

rowUpdated

public boolean rowUpdated()
This method tests whether or not the current row in the result set has been updated. Updates must be visible in order of this method to detect the update.

Returns: true if the row has been updated, false otherwise.

Throws: SQLException If an error occurs.

setFetchDirection

public void setFetchDirection(int direction)
This method provides a hint to the driver about which direction the result set will be processed in.

Parameters: direction The direction in which rows will be processed. The allowed values are the FETCH_* constants defined in this interface.

Throws: SQLException If an error occurs.

setFetchSize

public void setFetchSize(int rows)
This method provides a hint to the driver about how many rows at a time it should fetch from the database.

Parameters: rows The number of rows the driver should fetch per call.

Throws: SQLException If an error occurs.

updateArray

public void updateArray(int columnIndex, Array value)
This method updates the specified column to have a java.sqlArray value. This does not update the actual database. updateRow must be called in order to do that.

Throws: SQLException If an error occurs.

Since: 1.4

UNKNOWN: columnIndex The index of the column value to update. value The new value of the column.

updateArray

public void updateArray(String columnName, Array value)
This method updates the specified column to have a java.sqlArray value. This does not update the actual database. updateRow must be called in order to do that.

Throws: SQLException If an error occurs.

Since: 1.4

UNKNOWN: columnName The name of the column value to update. value The new value of the column.

updateAsciiStream

public void updateAsciiStream(int columnIndex, InputStream stream, int count)
This method updates the specified column from an ASCII text stream. This does not update the actual database. updateRow must be called in order to do that.

Parameters: columnIndex The index of the column to update. stream The stream from which the column value is updated. count The length of the stream.

Throws: SQLException If an error occurs.

updateAsciiStream

public void updateAsciiStream(String columnName, InputStream stream, int count)
This method updates the specified column from an ASCII text stream. This does not update the actual database. updateRow must be called in order to do that.

Parameters: columnName The name of the column to update. stream The stream from which the column value is updated. count The length of the stream.

Throws: SQLException If an error occurs.

updateBigDecimal

public void updateBigDecimal(int columnIndex, BigDecimal value)
This method updates the specified column to have a BigDecimal value. This does not update the actual database. updateRow must be called in order to do that.

Parameters: columnIndex The index of the column to update. value The new value of the column.

Throws: SQLException If an error occurs.

updateBigDecimal

public void updateBigDecimal(String columnName, BigDecimal value)
This method updates the specified column to have a BigDecimal value. This does not update the actual database. updateRow must be called in order to do that.

Parameters: columnName The name of the column to update. value The new value of the column.

Throws: SQLException If an error occurs.

updateBinaryStream

public void updateBinaryStream(int columnIndex, InputStream stream, int count)
This method updates the specified column from a binary stream. This does not update the actual database. updateRow must be called in order to do that.

Parameters: columnIndex The index of the column to update. stream The stream from which the column value is updated. count The length of the stream.

Throws: SQLException If an error occurs.

updateBinaryStream

public void updateBinaryStream(String columnName, InputStream stream, int count)
This method updates the specified column from a binary stream. This does not update the actual database. updateRow must be called in order to do that.

Parameters: columnName The name of the column to update. stream The stream from which the column value is updated. count The length of the stream.

Throws: SQLException If an error occurs.

updateBlob

public void updateBlob(int columnIndex, Blob value)
This method updates the specified column to have a java.sql.Blob value. This does not update the actual database. updateRow must be called in order to do that.

Throws: SQLException If an error occurs.

Since: 1.4

UNKNOWN: columnIndex The index of the column value to update. value The java.sql.Blob used to set the new value of the column.

updateBlob

public void updateBlob(String columnName, Blob value)
This method updates the specified column to have a java.sql.Blob value. This does not update the actual database. updateRow must be called in order to do that.

Throws: SQLException If an error occurs.

Since: 1.4

UNKNOWN: columnName The name of the column value to update. value The java.sql.Blob used to set the new value of the column.

updateBoolean

public void updateBoolean(int columnIndex, boolean value)
This method updates the specified column to have a boolean value. This does not update the actual database. updateRow must be called in order to do that.

Parameters: columnIndex The index of the column to update. value The new value of the column.

Throws: SQLException If an error occurs.

updateBoolean

public void updateBoolean(String columnName, boolean value)
This method updates the specified column to have a boolean value. This does not update the actual database. updateRow must be called in order to do that.

Parameters: columnName The name of the column to update. value The new value of the column.

Throws: SQLException If an error occurs.

updateByte

public void updateByte(int columnIndex, byte value)
This method updates the specified column to have a byte value. This does not update the actual database. updateRow must be called in order to do that.

Parameters: columnIndex The index of the column to update. value The new value of the column.

Throws: SQLException If an error occurs.

updateByte

public void updateByte(String columnName, byte value)
This method updates the specified column to have a byte value. This does not update the actual database. updateRow must be called in order to do that.

Parameters: columnName The name of the column to update. value The new value of the column.

Throws: SQLException If an error occurs.

updateBytes

public void updateBytes(int columnIndex, byte[] value)
This method updates the specified column to have a byte array value. This does not update the actual database. updateRow must be called in order to do that.

Parameters: columnIndex The index of the column to update. value The new value of the column.

Throws: SQLException If an error occurs.

updateBytes

public void updateBytes(String columnName, byte[] value)
This method updates the specified column to have a byte array value. This does not update the actual database. updateRow must be called in order to do that.

Parameters: columnName The name of the column to update. value The new value of the column.

Throws: SQLException If an error occurs.

updateCharacterStream

public void updateCharacterStream(int columnIndex, Reader reader, int count)
This method updates the specified column from a character stream. This does not update the actual database. updateRow must be called in order to do that.

Parameters: columnIndex The index of the column to update. reader The reader from which the column value is updated. count The length of the stream.

Throws: SQLException If an error occurs.

updateCharacterStream

public void updateCharacterStream(String columnName, Reader reader, int count)
This method updates the specified column from a character stream. This does not update the actual database. updateRow must be called in order to do that.

Parameters: columnName The name of the column to update. reader The reader from which the column value is updated. count The length of the stream.

Throws: SQLException If an error occurs.

updateClob

public void updateClob(int columnIndex, Clob value)
This method updates the specified column to have a java.sql.Clob value. This does not update the actual database. updateRow must be called in order to do that.

Throws: SQLException If an error occurs.

Since: 1.4

UNKNOWN: columnIndex The index of the column value to update. value The java.sql.Clob used to set the new value of the column.

updateClob

public void updateClob(String columnName, Clob value)
This method updates the specified column to have a java.sql.Clob value. This does not update the actual database. updateRow must be called in order to do that.

Throws: SQLException If an error occurs.

Since: 1.4

UNKNOWN: columnName The name of the column value to update. value The java.sql.Clob used to set the new value of the column.

updateDate

public void updateDate(int columnIndex, Date value)
This method updates the specified column to have a java.sql.Date value. This does not update the actual database. updateRow must be called in order to do that.

Parameters: columnIndex The index of the column to update. value The new value of the column.

Throws: SQLException If an error occurs.

updateDate

public void updateDate(String columnName, Date value)
This method updates the specified column to have a java.sql.Date value. This does not update the actual database. updateRow must be called in order to do that.

Parameters: columnName The name of the column to update. value The new value of the column.

Throws: SQLException If an error occurs.

updateDouble

public void updateDouble(int columnIndex, double value)
This method updates the specified column to have a double value. This does not update the actual database. updateRow must be called in order to do that.

Parameters: columnIndex The index of the column to update. value The new value of the column.

Throws: SQLException If an error occurs.

updateDouble

public void updateDouble(String columnName, double value)
This method updates the specified column to have a double value. This does not update the actual database. updateRow must be called in order to do that.

Parameters: columnName The name of the column to update. value The new value of the column.

Throws: SQLException If an error occurs.

updateFloat

public void updateFloat(int columnIndex, float value)
This method updates the specified column to have a float value. This does not update the actual database. updateRow must be called in order to do that.

Parameters: columnIndex The index of the column to update. value The new value of the column.

Throws: SQLException If an error occurs.

updateFloat

public void updateFloat(String columnName, float value)
This method updates the specified column to have a float value. This does not update the actual database. updateRow must be called in order to do that.

Parameters: columnName The name of the column to update. value The new value of the column.

Throws: SQLException If an error occurs.

updateInt

public void updateInt(int columnIndex, int value)
This method updates the specified column to have an int value. This does not update the actual database. updateRow must be called in order to do that.

Parameters: columnIndex The index of the column to update. value The new value of the column.

Throws: SQLException If an error occurs.

updateInt

public void updateInt(String columnName, int value)
This method updates the specified column to have an int value. This does not update the actual database. updateRow must be called in order to do that.

Parameters: columnName The name of the column to update. value The new value of the column.

Throws: SQLException If an error occurs.

updateLong

public void updateLong(int columnIndex, long value)
This method updates the specified column to have a long value. This does not update the actual database. updateRow must be called in order to do that.

Parameters: columnIndex The index of the column to update. value The new value of the column.

Throws: SQLException If an error occurs.

updateLong

public void updateLong(String columnName, long value)
This method updates the specified column to have a long value. This does not update the actual database. updateRow must be called in order to do that.

Parameters: columnName The name of the column to update. value The new value of the column.

Throws: SQLException If an error occurs.

updateNull

public void updateNull(int columnIndex)
This method updates the specified column to have a NULL value. This does not update the actual database. updateRow must be called in order to do that.

Parameters: columnIndex The index of the column to update.

Throws: SQLException If an error occurs.

updateNull

public void updateNull(String columnName)
This method updates the specified column to have a NULL value. This does not update the actual database. updateRow must be called in order to do that.

Parameters: columnName The name of the column to update.

Throws: SQLException If an error occurs.

updateObject

public void updateObject(int columnIndex, Object value, int scale)
This method updates the specified column to have an Object value. This does not update the actual database. updateRow must be called in order to do that.

Parameters: columnIndex The index of the column to update. value The new value of the column. scale The scale of the object in question, which is used only for numeric type objects.

Throws: SQLException If an error occurs.

updateObject

public void updateObject(int columnIndex, Object value)
This method updates the specified column to have an Object value. This does not update the actual database. updateRow must be called in order to do that.

Parameters: columnIndex The index of the column to update. value The new value of the column.

Throws: SQLException If an error occurs.

updateObject

public void updateObject(String columnName, Object value, int scale)
This method updates the specified column to have an Object value. This does not update the actual database. updateRow must be called in order to do that.

Parameters: columnName The name of the column to update. value The new value of the column. scale The scale of the object in question, which is used only for numeric type objects.

Throws: SQLException If an error occurs.

updateObject

public void updateObject(String columnName, Object value)
This method updates the specified column to have an Object value. This does not update the actual database. updateRow must be called in order to do that.

Parameters: columnName The name of the column to update. value The new value of the column.

Throws: SQLException If an error occurs.

updateRef

public void updateRef(int columnIndex, Ref value)
This method updates the specified column to have a java.sql.Ref value. This does not update the actual database. updateRow must be called in order to do that.

Throws: SQLException If an error occurs.

Since: 1.4

UNKNOWN: columnIndex The index of the column value to update. value The java.sql.Ref used to set the new value of the column.

updateRef

public void updateRef(String columnName, Ref value)
This method updates the specified column to have a java.sql.Ref value. This does not update the actual database. updateRow must be called in order to do that.

Throws: SQLException If an error occurs.

Since: 1.4

UNKNOWN: columnName The name of the column value to update. value The java.sql.Ref used to set the new value of the column.

updateRow

public void updateRow()
This method updates the current row in the database.

Throws: SQLException If an error occurs.

updateShort

public void updateShort(int columnIndex, short value)
This method updates the specified column to have a short value. This does not update the actual database. updateRow must be called in order to do that.

Parameters: columnIndex The index of the column to update. value The new value of the column.

Throws: SQLException If an error occurs.

updateShort

public void updateShort(String columnName, short value)
This method updates the specified column to have a short value. This does not update the actual database. updateRow must be called in order to do that.

Parameters: columnName The name of the column to update. value The new value of the column.

Throws: SQLException If an error occurs.

updateString

public void updateString(int columnIndex, String value)
This method updates the specified column to have a String value. This does not update the actual database. updateRow must be called in order to do that.

Parameters: columnIndex The index of the column to update. value The new value of the column.

Throws: SQLException If an error occurs.

updateString

public void updateString(String columnName, String value)
This method updates the specified column to have a String value. This does not update the actual database. updateRow must be called in order to do that.

Parameters: columnName The name of the column to update. value The new value of the column.

Throws: SQLException If an error occurs.

updateTime

public void updateTime(int columnIndex, Time value)
This method updates the specified column to have a java.sql.Time value. This does not update the actual database. updateRow must be called in order to do that.

Parameters: columnIndex The index of the column to update. value The new value of the column.

Throws: SQLException If an error occurs.

updateTime

public void updateTime(String columnName, Time value)
This method updates the specified column to have a java.sql.Time value. This does not update the actual database. updateRow must be called in order to do that.

Parameters: columnName The name of the column to update. value The new value of the column.

Throws: SQLException If an error occurs.

updateTimestamp

public void updateTimestamp(int columnIndex, Timestamp value)
This method updates the specified column to have a java.sql.Timestamp value. This does not update the actual database. updateRow must be called in order to do that.

Parameters: columnIndex The index of the column to update. value The new value of the column.

Throws: SQLException If an error occurs.

updateTimestamp

public void updateTimestamp(String columnName, Timestamp value)
This method updates the specified column to have a java.sql.Timestamp value. This does not update the actual database. updateRow must be called in order to do that.

Parameters: columnName The name of the column to update. value The new value of the column.

Throws: SQLException If an error occurs.

wasNull

public boolean wasNull()
This method tests whether the value of the last column that was fetched was actually a SQL NULL value.

Returns: true if the last column fetched was a NULL, false otherwise.

Throws: SQLException If an error occurs.