Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
public interface ResultSet
extends AutoCloseable
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 | |
static int | |
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int | |
static int |
|
static int |
|
static int |
|
Method Summary | |
boolean |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
int |
|
boolean |
|
Array |
|
Array | |
InputStream |
|
InputStream |
|
BigDecimal |
|
BigDecimal |
|
BigDecimal |
|
BigDecimal |
|
InputStream |
|
InputStream |
|
Blob |
|
Blob | |
boolean |
|
boolean |
|
byte |
|
byte | |
byte[] |
|
byte[] | |
Reader |
|
Reader |
|
Clob |
|
Clob | |
int |
|
String |
|
Date |
|
Date | |
Date | |
Date | |
double |
|
double | |
int |
|
int |
|
float |
|
float | |
int |
|
int | |
long |
|
long | |
ResultSetMetaData |
|
Object |
|
Object |
|
Object | |
Object | |
Ref |
|
Ref | |
int |
|
short |
|
short | |
Statement |
|
String |
|
String | |
Time |
|
Time | |
Time | |
Time | |
Timestamp |
|
Timestamp |
|
Timestamp |
|
Timestamp |
|
int |
|
URL |
|
URL | |
InputStream |
|
InputStream |
|
SQLWarning |
|
void |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
void |
|
void |
|
boolean |
|
boolean |
|
void |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void | |
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void | |
void | |
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
boolean |
|
Methods inherited from interface java.lang.AutoCloseable | |
close |
public static final int CONCUR_READ_ONLY
The concurrency mode of for the result set may not be modified.
- Field Value:
- 1007
public static final int CONCUR_UPDATABLE
The concurrency mode of for the result set may be modified.
- Field Value:
- 1008
public static final int FETCH_FORWARD
The rows will be processed in order from first to last.
- Field Value:
- 1000
public static final int FETCH_REVERSE
The rows will be processed in order from last to first.
- Field Value:
- 1001
public static final int FETCH_UNKNOWN
The rows will be processed in an unknown order
- Field Value:
- 1002
public static final int TYPE_FORWARD_ONLY
This type of result set may only step forward through the rows returned.
- Field Value:
- 1003
public static final int TYPE_SCROLL_INSENSITIVE
This type of result set is scrollable and is not sensitive to changes made by other statements.
- Field Value:
- 1004
public static final int TYPE_SCROLL_SENSITIVE
This type of result set is scrollable and is also sensitive to changes made by other statements.
- Field Value:
- 1005
public boolean absolute(int row) throws SQLException
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.
public void afterLast() throws SQLException
This method repositions the cursor to after the last row in the result set.
- Throws:
SQLException
- If an error occurs.
public void beforeFirst() throws SQLException
This method repositions the cursor to before the first row in the result set.
- Throws:
SQLException
- If an error occurs.
public void cancelRowUpdates() throws SQLException
This method cancels any changes that have been made to a row. If therowUpdate
method has been called, then the changes cannot be undone.
- Throws:
SQLException
- If an error occurs.
public void clearWarnings() throws SQLException
This method clears all warnings associated with this result set.
- Throws:
SQLException
- If an error occurs.
public void close() throws SQLException
This method closes the result set and frees any associated resources.
- Specified by:
- close in interface AutoCloseable
- Throws:
SQLException
- If an error occurs.
public void deleteRow() throws SQLException
This method deletes the current row in the database.
- Throws:
SQLException
- If an error occurs.
public int findColumn(String columnName) throws SQLException
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.
public boolean first() throws SQLException
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.
public Array getArray(int columnIndex) throws SQLException
This method returns the specified column value as anArray
.
- 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.
public Array getArray(String columnName) throws SQLException
This method returns the specified column value as anArray
.
- 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.
public InputStream getAsciiStream(int columnIndex) throws SQLException
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 callingnext()
orclose()
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.
public InputStream getAsciiStream(String columnName) throws SQLException
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 callingnext()
orclose()
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.
public BigDecimal getBigDecimal(int columnIndex) throws SQLException
This method returns the value of the specified column as a JavaBigDecimal
.
- Parameters:
columnIndex
- The index of the column to return.
- Returns:
- The column value as a
BigDecimal
.
- Throws:
SQLException
- If an error occurs.
public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException
Deprecated.
This method returns the value of the specified column as a JavaBigDecimal
.
- 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.
public BigDecimal getBigDecimal(String columnName) throws SQLException
This method returns the value of the specified column as a JavaBigDecimal
.
- Parameters:
columnName
- The name of the column to return.
- Returns:
- The column value as a
BigDecimal
.
- Throws:
SQLException
- If an error occurs.
public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException
Deprecated.
This method returns the value of the specified column as a JavaBigDecimal
.
- Parameters:
columnName
- The name of the column to return.
- Returns:
- The column value as a
BigDecimal
.
- Throws:
SQLException
- If an error occurs.
public InputStream getBinaryStream(int columnIndex) throws SQLException
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 callingnext()
orclose()
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.
public InputStream getBinaryStream(String columnName) throws SQLException
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 callingnext()
orclose()
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.
public Blob getBlob(int columnIndex) throws SQLException
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.
public Blob getBlob(String columnName) throws SQLException
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.
public boolean getBoolean(int columnIndex) throws SQLException
This method returns the value of the specified column as a Javaboolean
.
- Parameters:
columnIndex
- The index of the column to return.
- Returns:
- The column value as a
boolean
.
- Throws:
SQLException
- If an error occurs.
public boolean getBoolean(String columnName) throws SQLException
This method returns the value of the specified column as a Javaboolean
.
- Parameters:
columnName
- The name of the column to return.
- Returns:
- The column value as a
boolean
.
- Throws:
SQLException
- If an error occurs.
public byte getByte(int columnIndex) throws SQLException
This method returns the value of the specified column as a Javabyte
.
- Parameters:
columnIndex
- The index of the column to return.
- Returns:
- The column value as a
byte
.
- Throws:
SQLException
- If an error occurs.
public byte getByte(String columnName) throws SQLException
This method returns the value of the specified column as a Javabyte
.
- Parameters:
columnName
- The name of the column to return.
- Returns:
- The column value as a
byte
.
- Throws:
SQLException
- If an error occurs.
public byte[] getBytes(int columnIndex) throws SQLException
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.
public byte[] getBytes(String columnName) throws SQLException
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.
public Reader getCharacterStream(int columnIndex) throws SQLException
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 callingnext()
orclose()
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.
public Reader getCharacterStream(String columnName) throws SQLException
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 callingnext()
orclose()
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.
public Clob getClob(int columnIndex) throws SQLException
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.
public Clob getClob(String columnName) throws SQLException
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.
public int getConcurrency() throws SQLException
This method returns the concurrency type of this result set. This will be one of theCONCUR_*
constants defined in this interface.
- Returns:
- The result set concurrency type.
- Throws:
SQLException
- If an error occurs.
public String getCursorName() throws SQLException
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.
public Date getDate(int columnIndex) throws SQLException
This method returns the value of the specified column as a Javajava.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.
public Date getDate(int columnIndex, Calendar cal) throws SQLException
This method returns the specified column value as ajava.sql.Date
. The specifiedCalendar
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
- TheCalendar
to use for calculating timezones.
- Returns:
- The value of the column as a
java.sql.Date
.
- Throws:
SQLException
- If an error occurs.
public Date getDate(String columnName) throws SQLException
This method returns the value of the specified column as a Javajava.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.
public Date getDate(String columnName, Calendar cal) throws SQLException
This method returns the specified column value as ajava.sql.Date
. The specifiedCalendar
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
- TheCalendar
to use for calculating timezones.
- Returns:
- The value of the column as a
java.sql.Date
.
- Throws:
SQLException
- If an error occurs.
public double getDouble(int columnIndex) throws SQLException
This method returns the value of the specified column as a Javadouble
.
- Parameters:
columnIndex
- The index of the column to return.
- Returns:
- The column value as a
double
.
- Throws:
SQLException
- If an error occurs.
public double getDouble(String columnName) throws SQLException
This method returns the value of the specified column as a Javadouble
.
- Parameters:
columnName
- The name of the column to return.
- Returns:
- The column value as a
double
.
- Throws:
SQLException
- If an error occurs.
public int getFetchDirection() throws SQLException
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.
public int getFetchSize() throws SQLException
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.
public float getFloat(int columnIndex) throws SQLException
This method returns the value of the specified column as a Javafloat
.
- Parameters:
columnIndex
- The index of the column to return.
- Returns:
- The column value as a
float
.
- Throws:
SQLException
- If an error occurs.
public float getFloat(String columnName) throws SQLException
This method returns the value of the specified column as a Javafloat
.
- Parameters:
columnName
- The name of the column to return.
- Returns:
- The column value as a
float
.
- Throws:
SQLException
- If an error occurs.
public int getInt(int columnIndex) throws SQLException
This method returns the value of the specified column as a Javaint
.
- Parameters:
columnIndex
- The index of the column to return.
- Returns:
- The column value as a
int
.
- Throws:
SQLException
- If an error occurs.
public int getInt(String columnName) throws SQLException
This method returns the value of the specified column as a Javaint
.
- Parameters:
columnName
- The name of the column to return.
- Returns:
- The column value as a
int
.
- Throws:
SQLException
- If an error occurs.
public long getLong(int columnIndex) throws SQLException
This method returns the value of the specified column as a Javalong
.
- Parameters:
columnIndex
- The index of the column to return.
- Returns:
- The column value as a
long
.
- Throws:
SQLException
- If an error occurs.
public long getLong(String columnName) throws SQLException
This method returns the value of the specified column as a Javalong
.
- Parameters:
columnName
- The name of the column to return.
- Returns:
- The column value as a
long
.
- Throws:
SQLException
- If an error occurs.
public ResultSetMetaData getMetaData() throws SQLException
This method returns data about the columns returned as part of the result set as aResultSetMetaData
instance.
- Returns:
- The
ResultSetMetaData
instance for this result set.
- Throws:
SQLException
- If an error occurs.
public Object getObject(int columnIndex) throws SQLException
This method returns the value of the specified column as a JavaObject
.
- Parameters:
columnIndex
- The index of the column to return.
- Returns:
- The column value as an
Object
.
- Throws:
SQLException
- If an error occurs.
public Object getObject(int columnIndex, Map> map) throws SQLException
This method returns the value of the specified column as a JavaObject
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.
public Object getObject(String columnName) throws SQLException
This method returns the value of the specified column as a JavaObject
.
- Parameters:
columnName
- The name of the column to return.
- Returns:
- The column value as an
Object
.
- Throws:
SQLException
- If an error occurs.
public Object getObject(String columnName, Map> map) throws SQLException
This method returns the value of the specified column as a JavaObject
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.
public Ref getRef(int columnIndex) throws SQLException
This method returns aRef
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.
public Ref getRef(String columnName) throws SQLException
This method returns aRef
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.
public int getRow() throws SQLException
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.
public short getShort(int columnIndex) throws SQLException
This method returns the value of the specified column as a Javashort
.
- Parameters:
columnIndex
- The index of the column to return.
- Returns:
- The column value as a
short
.
- Throws:
SQLException
- If an error occurs.
public short getShort(String columnName) throws SQLException
This method returns the value of the specified column as a Javashort
.
- Parameters:
columnName
- The name of the column to return.
- Returns:
- The column value as a
short
.
- Throws:
SQLException
- If an error occurs.
public Statement getStatement() throws SQLException
This method returns a theStatement
that was used to produce this result set.
- Returns:
- The
Statement
used to produce this result set.
- Throws:
SQLException
- If an error occurs.
public String getString(int columnIndex) throws SQLException
This method returns the value of the specified column as a JavaString
.
- Parameters:
columnIndex
- The index of the column to return.
- Returns:
- The column value as a
String
.
- Throws:
SQLException
- If an error occurs.
public String getString(String columnName) throws SQLException
This method returns the value of the specified column as a JavaString
.
- Parameters:
columnName
- The name of the column to return.
- Returns:
- The column value as a
String
.
- Throws:
SQLException
- If an error occurs.
public Time getTime(int columnIndex) throws SQLException
This method returns the value of the specified column as a Javajava.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.
public Time getTime(int columnIndex, Calendar cal) throws SQLException
This method returns the specified column value as ajava.sql.Time
. The specifiedCalendar
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
- TheCalendar
to use for calculating timezones.
- Returns:
- The value of the column as a
java.sql.Time
.
- Throws:
SQLException
- If an error occurs.
public Time getTime(String columnName) throws SQLException
This method returns the value of the specified column as a Javajava.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.
public Time getTime(String columnName, Calendar cal) throws SQLException
This method returns the specified column value as ajava.sql.Time
. The specifiedCalendar
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
- TheCalendar
to use for calculating timezones.
- Returns:
- The value of the column as a
java.sql.Time
.
- Throws:
SQLException
- If an error occurs.
public Timestamp getTimestamp(int columnIndex) throws SQLException
This method returns the value of the specified column as a Javajava.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.
public Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException
This method returns the specified column value as ajava.sql.Timestamp
. The specifiedCalendar
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
- TheCalendar
to use for calculating timezones.
- Returns:
- The value of the column as a
java.sql.Timestamp
.
- Throws:
SQLException
- If an error occurs.
public Timestamp getTimestamp(String columnName) throws SQLException
This method returns the value of the specified column as a Javajava.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.
public Timestamp getTimestamp(String columnName, Calendar cal) throws SQLException
This method returns the specified column value as ajava.sql.Timestamp
. The specifiedCalendar
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
- TheCalendar
to use for calculating timezones.
- Returns:
- The value of the column as a
java.sql.Timestamp
.
- Throws:
SQLException
- If an error occurs.
public int getType() throws SQLException
This method returns the result set type of this result set. This will be one of theTYPE_*
constants defined in this interface.
- Returns:
- The result set type.
- Throws:
SQLException
- If an error occurs.
public URL getURL(int columnIndex) throws SQLException
This method returns the specified column value as ajava.net.URL
.
- Parameters:
columnIndex
- The index of the column value to return.
- Throws:
SQLException
- If an error occurs.
- Since:
- 1.4
public URL getURL(String columnName) throws SQLException
This method returns the specified column value as ajava.net.URL
.
- Parameters:
columnName
- The name of the column value to return.
- Throws:
SQLException
- If an error occurs.
- Since:
- 1.4
public InputStream getUnicodeStream(int columnIndex) throws SQLException
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 callingnext()
orclose()
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.
public InputStream getUnicodeStream(String columnName) throws SQLException
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 callingnext()
orclose()
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.
public SQLWarning getWarnings() throws SQLException
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.
public void insertRow() throws SQLException
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.
public boolean isAfterLast() throws SQLException
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.
public boolean isBeforeFirst() throws SQLException
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.
public boolean isFirst() throws SQLException
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.
public boolean isLast() throws SQLException
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.
public boolean last() throws SQLException
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.
public void moveToCurrentRow() throws SQLException
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.
public void moveToInsertRow() throws SQLException
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.
public boolean next() throws SQLException
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.
public boolean previous() throws SQLException
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.
public void refreshRow() throws SQLException
This method refreshes the contents of the current row from the database.
- Throws:
SQLException
- If an error occurs.
public boolean relative(int rows) throws SQLException
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.
public boolean rowDeleted() throws SQLException
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.
public boolean rowInserted() throws SQLException
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.
public boolean rowUpdated() throws SQLException
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.
public void setFetchDirection(int direction) throws SQLException
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 theFETCH_*
constants defined in this interface.
- Throws:
SQLException
- If an error occurs.
public void setFetchSize(int rows) throws SQLException
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.
public void updateArray(int columnIndex, Array value) throws SQLException
This method updates the specified column to have ajava.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
public void updateArray(String columnName, Array value) throws SQLException
This method updates the specified column to have ajava.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
public void updateAsciiStream(int columnIndex, InputStream stream, int count) throws SQLException
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.
public void updateAsciiStream(String columnName, InputStream stream, int count) throws SQLException
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.
public void updateBigDecimal(int columnIndex, BigDecimal value) throws SQLException
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.
public void updateBigDecimal(String columnName, BigDecimal value) throws SQLException
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.
public void updateBinaryStream(int columnIndex, InputStream stream, int count) throws SQLException
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.
public void updateBinaryStream(String columnName, InputStream stream, int count) throws SQLException
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.
public void updateBlob(int columnIndex, Blob value) throws SQLException
This method updates the specified column to have ajava.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
public void updateBlob(String columnName, Blob value) throws SQLException
This method updates the specified column to have ajava.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
public void updateBoolean(int columnIndex, boolean value) throws SQLException
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.
public void updateBoolean(String columnName, boolean value) throws SQLException
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.
public void updateByte(int columnIndex, byte value) throws SQLException
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.
public void updateByte(String columnName, byte value) throws SQLException
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.
public void updateBytes(int columnIndex, byte[] value) throws SQLException
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.
public void updateBytes(String columnName, byte[] value) throws SQLException
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.
public void updateCharacterStream(int columnIndex, Reader reader, int count) throws SQLException
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.
public void updateCharacterStream(String columnName, Reader reader, int count) throws SQLException
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.
public void updateClob(int columnIndex, Clob value) throws SQLException
This method updates the specified column to have ajava.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
public void updateClob(String columnName, Clob value) throws SQLException
This method updates the specified column to have ajava.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
public void updateDate(int columnIndex, Date value) throws SQLException
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.
public void updateDate(String columnName, Date value) throws SQLException
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.
public void updateDouble(int columnIndex, double value) throws SQLException
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.
public void updateDouble(String columnName, double value) throws SQLException
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.
public void updateFloat(int columnIndex, float value) throws SQLException
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.
public void updateFloat(String columnName, float value) throws SQLException
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.
public void updateInt(int columnIndex, int value) throws SQLException
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.
public void updateInt(String columnName, int value) throws SQLException
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.
public void updateLong(int columnIndex, long value) throws SQLException
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.
public void updateLong(String columnName, long value) throws SQLException
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.
public void updateNull(int columnIndex) throws SQLException
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.
public void updateNull(String columnName) throws SQLException
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.
public void updateObject(int columnIndex, Object value) throws SQLException
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.
public void updateObject(int columnIndex, Object value, int scale) throws SQLException
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.
public void updateObject(String columnName, Object value) throws SQLException
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.
public void updateObject(String columnName, Object value, int scale) throws SQLException
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.
public void updateRef(int columnIndex, Ref value) throws SQLException
This method updates the specified column to have ajava.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
public void updateRef(String columnName, Ref value) throws SQLException
This method updates the specified column to have ajava.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
public void updateRow() throws SQLException
This method updates the current row in the database.
- Throws:
SQLException
- If an error occurs.
public void updateShort(int columnIndex, short value) throws SQLException
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.
public void updateShort(String columnName, short value) throws SQLException
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.
public void updateString(int columnIndex, String value) throws SQLException
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.
public void updateString(String columnName, String value) throws SQLException
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.
public void updateTime(int columnIndex, Time value) throws SQLException
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.
public void updateTime(String columnName, Time value) throws SQLException
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.
public void updateTimestamp(int columnIndex, Timestamp value) throws SQLException
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.
public void updateTimestamp(String columnName, Timestamp value) throws SQLException
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.
public boolean wasNull() throws SQLException
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.