java.sql
Interface ResultSet
java.lang.Object
|
+--java.sql.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.
Author:- Aaron M. Renn (arenn@urbanophile.com)
boolean | absolute(int row)
|
void | afterLast()
|
void | beforeFirst()
|
void | cancelRowUpdates()
|
void | clearWarnings()
|
void | close()
|
void | deleteRow()
|
int | findColumn(java.lang.String columnName)
|
boolean | first()
|
java.sql.Array | getArray(int i)
|
java.sql.Array | getArray(java.lang.String colName)
|
java.io.InputStream | getAsciiStream(int columnIndex)
|
java.io.InputStream | getAsciiStream(java.lang.String columnName)
|
java.math.BigDecimal | getBigDecimal(int columnIndex, int scale)
|
java.math.BigDecimal | getBigDecimal(java.lang.String columnName, int scale)
|
java.math.BigDecimal | getBigDecimal(int columnIndex)
|
java.math.BigDecimal | getBigDecimal(java.lang.String columnName)
|
java.io.InputStream | getBinaryStream(int columnIndex)
|
java.io.InputStream | getBinaryStream(java.lang.String columnName)
|
java.sql.Blob | getBlob(int i)
|
java.sql.Blob | getBlob(java.lang.String colName)
|
boolean | getBoolean(int columnIndex)
|
boolean | getBoolean(java.lang.String columnName)
|
byte | getByte(int columnIndex)
|
byte | getByte(java.lang.String columnName)
|
byte[] | getBytes(int columnIndex)
|
byte[] | getBytes(java.lang.String columnName)
|
java.io.Reader | getCharacterStream(int columnIndex)
|
java.io.Reader | getCharacterStream(java.lang.String columnName)
|
java.sql.Clob | getClob(int i)
|
java.sql.Clob | getClob(java.lang.String colName)
|
int | getConcurrency()
|
java.lang.String | getCursorName()
|
java.sql.Date | getDate(int columnIndex)
|
java.sql.Date | getDate(java.lang.String columnName)
|
java.sql.Date | getDate(int columnIndex, java.util.Calendar cal)
|
java.sql.Date | getDate(java.lang.String columnName, java.util.Calendar cal)
|
double | getDouble(int columnIndex)
|
double | getDouble(java.lang.String columnName)
|
int | getFetchDirection()
|
int | getFetchSize()
|
float | getFloat(int columnIndex)
|
float | getFloat(java.lang.String columnName)
|
int | getInt(int columnIndex)
|
int | getInt(java.lang.String columnName)
|
long | getLong(int columnIndex)
|
long | getLong(java.lang.String columnName)
|
java.sql.ResultSetMetaData | getMetaData()
|
java.lang.Object | getObject(int columnIndex)
|
java.lang.Object | getObject(java.lang.String columnName)
|
java.lang.Object | getObject(int i, java.util.Map map)
|
java.lang.Object | getObject(java.lang.String colName, java.util.Map map)
|
java.sql.Ref | getRef(int i)
|
java.sql.Ref | getRef(java.lang.String colName)
|
int | getRow()
|
short | getShort(int columnIndex)
|
short | getShort(java.lang.String columnName)
|
java.sql.Statement | getStatement()
|
java.lang.String | getString(int columnIndex)
|
java.lang.String | getString(java.lang.String columnName)
|
java.sql.Time | getTime(int columnIndex)
|
java.sql.Time | getTime(java.lang.String columnName)
|
java.sql.Time | getTime(int columnIndex, java.util.Calendar cal)
|
java.sql.Time | getTime(java.lang.String columnName, java.util.Calendar cal)
|
java.sql.Timestamp | getTimestamp(int columnIndex)
|
java.sql.Timestamp | getTimestamp(java.lang.String columnName)
|
java.sql.Timestamp | getTimestamp(int columnIndex, java.util.Calendar cal)
|
java.sql.Timestamp | getTimestamp(java.lang.String columnName, java.util.Calendar cal)
|
int | getType()
|
java.net.URL | getURL(int columnIndex)
|
java.net.URL | getURL(java.lang.String columnName)
|
java.io.InputStream | getUnicodeStream(int columnIndex)
|
java.io.InputStream | getUnicodeStream(java.lang.String columnName)
|
java.sql.SQLWarning | getWarnings()
|
void | insertRow()
|
boolean | isAfterLast()
|
boolean | isBeforeFirst()
|
boolean | isFirst()
|
boolean | isLast()
|
boolean | last()
|
void | moveToCurrentRow()
|
void | moveToInsertRow()
|
boolean | next()
|
boolean | previous()
|
void | refreshRow()
|
boolean | relative(int rows)
|
boolean | rowDeleted()
|
boolean | rowInserted()
|
boolean | rowUpdated()
|
void | setFetchDirection(int direction)
|
void | setFetchSize(int rows)
|
void | updateArray(int columnIndex, java.sql.Array x)
|
void | updateArray(java.lang.String columnName, java.sql.Array x)
|
void | updateAsciiStream(int columnIndex, java.io.InputStream x, int length)
|
void | updateAsciiStream(java.lang.String columnName, java.io.InputStream x, int length)
|
void | updateBigDecimal(int columnIndex, java.math.BigDecimal x)
|
void | updateBigDecimal(java.lang.String columnName, java.math.BigDecimal x)
|
void | updateBinaryStream(int columnIndex, java.io.InputStream x, int length)
|
void | updateBinaryStream(java.lang.String columnName, java.io.InputStream x, int length)
|
void | updateBlob(int columnIndex, java.sql.Blob x)
|
void | updateBlob(java.lang.String columnName, java.sql.Blob x)
|
void | updateBoolean(int columnIndex, boolean x)
|
void | updateBoolean(java.lang.String columnName, boolean x)
|
void | updateByte(int columnIndex, byte x)
|
void | updateByte(java.lang.String columnName, byte x)
|
void | updateBytes(int columnIndex, byte[] x)
|
void | updateBytes(java.lang.String columnName, byte[] x)
|
void | updateCharacterStream(int columnIndex, java.io.Reader x, int length)
|
void | updateCharacterStream(java.lang.String columnName, java.io.Reader reader, int length)
|
void | updateClob(int columnIndex, java.sql.Clob x)
|
void | updateClob(java.lang.String columnName, java.sql.Clob x)
|
void | updateDate(int columnIndex, java.sql.Date x)
|
void | updateDate(java.lang.String columnName, java.sql.Date x)
|
void | updateDouble(int columnIndex, double x)
|
void | updateDouble(java.lang.String columnName, double x)
|
void | updateFloat(int columnIndex, float x)
|
void | updateFloat(java.lang.String columnName, float x)
|
void | updateInt(int columnIndex, int x)
|
void | updateInt(java.lang.String columnName, int x)
|
void | updateLong(int columnIndex, long x)
|
void | updateLong(java.lang.String columnName, long x)
|
void | updateNull(int columnIndex)
|
void | updateNull(java.lang.String columnName)
|
void | updateObject(int columnIndex, java.lang.Object x, int scale)
|
void | updateObject(int columnIndex, java.lang.Object x)
|
void | updateObject(java.lang.String columnName, java.lang.Object x, int scale)
|
void | updateObject(java.lang.String columnName, java.lang.Object x)
|
void | updateRef(int columnIndex, java.sql.Ref x)
|
void | updateRef(java.lang.String columnName, java.sql.Ref x)
|
void | updateRow()
|
void | updateShort(int columnIndex, short x)
|
void | updateShort(java.lang.String columnName, short x)
|
void | updateString(int columnIndex, java.lang.String x)
|
void | updateString(java.lang.String columnName, java.lang.String x)
|
void | updateTime(int columnIndex, java.sql.Time x)
|
void | updateTime(java.lang.String columnName, java.sql.Time x)
|
void | updateTimestamp(int columnIndex, java.sql.Timestamp x)
|
void | updateTimestamp(java.lang.String columnName, java.sql.Timestamp x)
|
boolean | wasNull()
|
CLOSE_CURSORS_AT_COMMIT
public static final int CLOSE_CURSORS_AT_COMMIT
CONCUR_READ_ONLY
public static final int CONCUR_READ_ONLY
The concurrency mode of for the result set may not be modified.
CONCUR_UPDATABLE
public static final int CONCUR_UPDATABLE
The concurrency mode of for the result set may be modified.
FETCH_FORWARD
public static final int FETCH_FORWARD
The rows will be processed in order from first to last.
FETCH_REVERSE
public static final int FETCH_REVERSE
The rows will be processed in order from last to first.
FETCH_UNKNOWN
public static final int FETCH_UNKNOWN
The rows will be processed in an unknown order
HOLD_CURSORS_OVER_COMMIT
public static final int HOLD_CURSORS_OVER_COMMIT
TYPE_FORWARD_ONLY
public static final int TYPE_FORWARD_ONLY
This type of result set may only step forward through the rows returned.
TYPE_SCROLL_INSENSITIVE
public static final 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 static final int TYPE_SCROLL_SENSITIVE
This type of result set is scrollable and is also sensitive to changes
made by other statements.
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:
Returns:
true
if the current position was changed,
false
otherwise.
Throws:
afterLast
public void afterLast()
This method repositions the cursor to after the last row in the result
set.
Throws:
beforeFirst
public void beforeFirst()
This method repositions the cursor to before the first row in the
result set.
Throws:
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:
clearWarnings
public void clearWarnings()
This method clears all warnings associated with this result set.
Throws:
close
public void close()
This method closes the result set and frees any associated resources.
Throws:
deleteRow
public void deleteRow()
This method deletes the current row in the database.
Throws:
findColumn
public int findColumn(java.lang.String columnName)
This method returns the column index of the specified named column.
Parameters:
Returns:
Throws:
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:
getArray
public Array getArray(int i)
This method returns the specified column value as an Array
.
Parameters:
Returns:
- The value of the column as an
Array
.
Throws:
getArray
public Array getArray(java.lang.String colName)
This method returns the specified column value as an Array
.
Parameters:
Returns:
- The value of the column as an
Array
.
Throws:
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:
Returns:
- The column value as an ASCII
InputStream
.
Throws:
getAsciiStream
public InputStream getAsciiStream(java.lang.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:
Returns:
- The column value as an ASCII
InputStream
.
Throws:
getBigDecimal
public BigDecimal getBigDecimal(int columnIndex)
This method returns the value of the specified column as a Java
BigDecimal
.
Parameters:
Returns:
- The column value as a
BigDecimal
.
Throws:
getBigDecimal
public BigDecimal getBigDecimal(int columnIndex, int scale)
This method returns the value of the specified column as a Java
BigDecimal
.
Parameters:
Returns:
- The column value as a
BigDecimal
.
Throws:
getBigDecimal
public BigDecimal getBigDecimal(java.lang.String columnName)
This method returns the value of the specified column as a Java
BigDecimal
.
Parameters:
Returns:
- The column value as a
BigDecimal
.
Throws:
getBigDecimal
public BigDecimal getBigDecimal(java.lang.String columnName, int scale)
This method returns the value of the specified column as a Java
BigDecimal
.
Parameters:
Returns:
- The column value as a
BigDecimal
.
Throws:
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:
Returns:
- The column value as a raw byte
InputStream
.
Throws:
getBinaryStream
public InputStream getBinaryStream(java.lang.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:
Returns:
- The column value as a raw byte
InputStream
.
Throws:
getBlob
public Blob getBlob(int i)
This method returns the specified column value as a BLOB.
Parameters:
Returns:
- The value of the column as a BLOB.
Throws:
getBlob
public Blob getBlob(java.lang.String colName)
This method returns the specified column value as a BLOB.
Parameters:
Returns:
- The value of the column as a BLOB.
Throws:
getBoolean
public boolean getBoolean(int columnIndex)
This method returns the value of the specified column as a Java
boolean
.
Parameters:
Returns:
- The column value as a
boolean
.
Throws:
getBoolean
public boolean getBoolean(java.lang.String columnName)
This method returns the value of the specified column as a Java
boolean
.
Parameters:
Returns:
- The column value as a
boolean
.
Throws:
getByte
public byte getByte(int columnIndex)
This method returns the value of the specified column as a Java
byte
.
Parameters:
Returns:
- The column value as a
byte
.
Throws:
getByte
public byte getByte(java.lang.String columnName)
This method returns the value of the specified column as a Java
byte
.
Parameters:
Returns:
- The column value as a
byte
.
Throws:
getBytes
public byte[] getBytes(int columnIndex)
This method returns the value of the specified column as a Java
byte array.
Parameters:
Returns:
- The column value as a byte array
Throws:
getBytes
public byte[] getBytes(java.lang.String columnName)
This method returns the value of the specified column as a Java
byte array.
Parameters:
Returns:
- The column value as a byte array
Throws:
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:
Returns:
- The column value as an character
Reader
.
Throws:
getCharacterStream
public Reader getCharacterStream(java.lang.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:
Returns:
- The column value as an character
Reader
.
Throws:
getClob
public Clob getClob(int i)
This method returns the specified column value as a CLOB.
Parameters:
Returns:
- The value of the column as a CLOB.
Throws:
getClob
public Clob getClob(java.lang.String colName)
This method returns the specified column value as a CLOB.
Parameters:
Returns:
- The value of the column as a CLOB.
Throws:
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:
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:
getDate
public Date getDate(int columnIndex)
This method returns the value of the specified column as a Java
java.sql.Date
.
Parameters:
Returns:
- The column value as a
java.sql.Date
.
Throws:
getDate
public Date getDate(int columnIndex, java.util.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:
Returns:
- The value of the column as a
java.sql.Date
.
Throws:
getDate
public Date getDate(java.lang.String columnName)
This method returns the value of the specified column as a Java
java.sql.Date
.
Parameters:
Returns:
- The column value as a
java.sql.Date
.
Throws:
getDate
public Date getDate(java.lang.String columnName, java.util.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:
Returns:
- The value of the column as a
java.sql.Date
.
Throws:
getDouble
public double getDouble(int columnIndex)
This method returns the value of the specified column as a Java
double
.
Parameters:
Returns:
- The column value as a
double
.
Throws:
getDouble
public double getDouble(java.lang.String columnName)
This method returns the value of the specified column as a Java
double
.
Parameters:
Returns:
- The column value as a
double
.
Throws:
getFetchDirection
public int getFetchDirection()
This method returns the current fetch direction for this result set.
Returns:
- The fetch direction for this result set.
Throws:
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:
getFloat
public float getFloat(int columnIndex)
This method returns the value of the specified column as a Java
float
.
Parameters:
Returns:
- The column value as a
float
.
Throws:
getFloat
public float getFloat(java.lang.String columnName)
This method returns the value of the specified column as a Java
float
.
Parameters:
Returns:
- The column value as a
float
.
Throws:
getInt
public int getInt(int columnIndex)
This method returns the value of the specified column as a Java
int
.
Parameters:
Returns:
- The column value as a
int
.
Throws:
getInt
public int getInt(java.lang.String columnName)
This method returns the value of the specified column as a Java
int
.
Parameters:
Returns:
- The column value as a
int
.
Throws:
getLong
public long getLong(int columnIndex)
This method returns the value of the specified column as a Java
long
.
Parameters:
Returns:
- The column value as a
long
.
Throws:
getLong
public long getLong(java.lang.String columnName)
This method returns the value of the specified column as a Java
long
.
Parameters:
Returns:
- The column value as a
long
.
Throws:
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:
getObject
public Object getObject(int columnIndex)
This method returns the value of the specified column as a Java
Object
.
Parameters:
Returns:
- The column value as an
Object
.
Throws:
getObject
public Object getObject(int i, java.util.Map map)
This method returns the value of the specified column as a Java
Object
using the specified SQL type to Java type map.
Parameters:
Returns:
- The value of the column as an
Object
.
Throws:
getObject
public Object getObject(java.lang.String columnName)
This method returns the value of the specified column as a Java
Object
.
Parameters:
Returns:
- The column value as an
Object
.
Throws:
getObject
public Object getObject(java.lang.String colName, java.util.Map map)
This method returns the value of the specified column as a Java
Object
using the specified SQL type to Java type map.
Parameters:
Returns:
- The value of the column as an
Object
.
Throws:
getRef
public Ref getRef(int i)
This method returns a Ref
for the specified column which
represents the structured type for the column.
Parameters:
Returns:
- A
Ref
object for the column
Throws:
getRef
public Ref getRef(java.lang.String colName)
This method returns a Ref
for the specified column which
represents the structured type for the column.
Parameters:
Returns:
- A
Ref
object for the column
Throws:
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:
getShort
public short getShort(int columnIndex)
This method returns the value of the specified column as a Java
short
.
Parameters:
Returns:
- The column value as a
short
.
Throws:
getShort
public short getShort(java.lang.String columnName)
This method returns the value of the specified column as a Java
short
.
Parameters:
Returns:
- The column value as a
short
.
Throws:
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:
getString
public String getString(int columnIndex)
This method returns the value of the specified column as a Java
String
.
Parameters:
Returns:
- The column value as a
String
.
Throws:
getString
public String getString(java.lang.String columnName)
This method returns the value of the specified column as a Java
String
.
Parameters:
Returns:
- The column value as a
String
.
Throws:
getTime
public Time getTime(int columnIndex)
This method returns the value of the specified column as a Java
java.sql.Time
.
Parameters:
Returns:
- The column value as a
java.sql.Time
.
Throws:
getTime
public Time getTime(int columnIndex, java.util.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:
Returns:
- The value of the column as a
java.sql.Time
.
Throws:
getTime
public Time getTime(java.lang.String columnName)
This method returns the value of the specified column as a Java
java.sql.Time
.
Parameters:
Returns:
- The column value as a
java.sql.Time
.
Throws:
getTime
public Time getTime(java.lang.String columnName, java.util.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:
Returns:
- The value of the column as a
java.sql.Time
.
Throws:
getTimestamp
public Timestamp getTimestamp(int columnIndex)
This method returns the value of the specified column as a Java
java.sql.Timestamp
.
Parameters:
Returns:
- The column value as a
java.sql.Timestamp
.
Throws:
getTimestamp
public Timestamp getTimestamp(int columnIndex, java.util.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:
Returns:
- The value of the column as a
java.sql.Timestamp
.
Throws:
getTimestamp
public Timestamp getTimestamp(java.lang.String columnName)
This method returns the value of the specified column as a Java
java.sql.Timestamp
.
Parameters:
Returns:
- The column value as a
java.sql.Timestamp
.
Throws:
getTimestamp
public Timestamp getTimestamp(java.lang.String columnName, java.util.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:
Returns:
- The value of the column as a
java.sql.Timestamp
.
Throws:
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:
Throws:
getURL
public URL getURL(int columnIndex)
Since:Parameters:
getURL
public URL getURL(java.lang.String columnName)
Since:Parameters:
getUnicodeStream
public InputStream getUnicodeStream(int columnIndex)
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:
Returns:
- The column value as a Unicode UTF-8
InputStream
.
Throws:
getUnicodeStream
public InputStream getUnicodeStream(java.lang.String columnName)
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:
Returns:
- The column value as a Unicode UTF-8
InputStream
.
Throws:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
refreshRow
public void refreshRow()
This method refreshes the contents of the current row from the database.
Throws:
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:
Returns:
true
if the current position was changed,
false
otherwise.
Throws:
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:
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:
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:
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:
Throws:
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:
Throws:
updateArray
public void updateArray(int columnIndex, java.sql.Array x)
Since:Parameters:
updateArray
public void updateArray(java.lang.String columnName, java.sql.Array x)
Since:Parameters:
updateAsciiStream
public void updateAsciiStream(int columnIndex, java.io.InputStream x, int length)
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:
Throws:
updateAsciiStream
public void updateAsciiStream(java.lang.String columnName, java.io.InputStream x, int length)
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:
Throws:
updateBigDecimal
public void updateBigDecimal(int columnIndex, java.math.BigDecimal x)
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:
Throws:
updateBigDecimal
public void updateBigDecimal(java.lang.String columnName, java.math.BigDecimal x)
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:
Throws:
updateBinaryStream
public void updateBinaryStream(int columnIndex, java.io.InputStream x, int length)
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:
Throws:
updateBinaryStream
public void updateBinaryStream(java.lang.String columnName, java.io.InputStream x, int length)
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:
Throws:
updateBlob
public void updateBlob(int columnIndex, java.sql.Blob x)
Since:Parameters:
updateBlob
public void updateBlob(java.lang.String columnName, java.sql.Blob x)
Since:Parameters:
updateBoolean
public void updateBoolean(int columnIndex, boolean x)
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:
Throws:
updateBoolean
public void updateBoolean(java.lang.String columnName, boolean x)
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:
Throws:
updateByte
public void updateByte(int columnIndex, byte x)
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:
Throws:
updateByte
public void updateByte(java.lang.String columnName, byte x)
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:
Throws:
updateBytes
public void updateBytes(int columnIndex, byte[] x)
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:
Throws:
updateBytes
public void updateBytes(java.lang.String columnName, byte[] x)
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:
Throws:
updateCharacterStream
public void updateCharacterStream(int columnIndex, java.io.Reader x, int length)
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:
Throws:
updateCharacterStream
public void updateCharacterStream(java.lang.String columnName, java.io.Reader reader, int length)
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:
Throws:
updateClob
public void updateClob(int columnIndex, java.sql.Clob x)
Since:Parameters:
updateClob
public void updateClob(java.lang.String columnName, java.sql.Clob x)
Since:Parameters:
updateDate
public void updateDate(int columnIndex, java.sql.Date x)
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:
Throws:
updateDate
public void updateDate(java.lang.String columnName, java.sql.Date x)
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:
Throws:
updateDouble
public void updateDouble(int columnIndex, double x)
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:
Throws:
updateDouble
public void updateDouble(java.lang.String columnName, double x)
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:
Throws:
updateFloat
public void updateFloat(int columnIndex, float x)
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:
Throws:
updateFloat
public void updateFloat(java.lang.String columnName, float x)
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:
Throws:
updateInt
public void updateInt(int columnIndex, int x)
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:
Throws:
updateInt
public void updateInt(java.lang.String columnName, int x)
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:
Throws:
updateLong
public void updateLong(int columnIndex, long x)
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:
Throws:
updateLong
public void updateLong(java.lang.String columnName, long x)
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:
Throws:
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:
Returns:
- index The index of the column to update.
Throws:
updateNull
public void updateNull(java.lang.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:
Returns:
- name The name of the column to update.
Throws:
updateObject
public void updateObject(int columnIndex, java.lang.Object x)
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:
Throws:
updateObject
public void updateObject(int columnIndex, java.lang.Object x, 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:
Throws:
updateObject
public void updateObject(java.lang.String columnName, java.lang.Object x)
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:
Throws:
updateObject
public void updateObject(java.lang.String columnName, java.lang.Object x, 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:
Throws:
updateRef
public void updateRef(int columnIndex, java.sql.Ref x)
Since:Parameters:
updateRef
public void updateRef(java.lang.String columnName, java.sql.Ref x)
Since:Parameters:
updateRow
public void updateRow()
This method updates the current row in the database.
Throws:
updateShort
public void updateShort(int columnIndex, short x)
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:
Throws:
updateShort
public void updateShort(java.lang.String columnName, short x)
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:
Throws:
updateString
public void updateString(int columnIndex, java.lang.String x)
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:
Throws:
updateString
public void updateString(java.lang.String columnName, java.lang.String x)
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:
Throws:
updateTime
public void updateTime(int columnIndex, java.sql.Time x)
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:
Throws:
updateTime
public void updateTime(java.lang.String columnName, java.sql.Time x)
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:
Throws:
updateTimestamp
public void updateTimestamp(int columnIndex, java.sql.Timestamp x)
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:
Throws:
updateTimestamp
public void updateTimestamp(java.lang.String columnName, java.sql.Timestamp x)
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:
Throws:
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:
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.