|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--ModSQL.ResultSet
A ResultSet provides access to a table of data. A ResultSet object is usually generated by executing a Statement.
A ResultSet maintains a cursor pointing to its current row of data. Initially the cursor is positioned before the first row. The 'next' method moves the cursor to the next row.
The getXXX methods retrieve column values for the current row. You can retrieve values either using the index number of the column, or by using the name of the column. In general using the column index will be more efficient. Columns are numbered from 1.
For maximum portability, ResultSet columns within each row should be read in left-to-right order and each column should be read only once.
For the getXXX methods, the JDBC driver attempts to convert the underlying data to the specified Java type and returns a suitable Java value. See the JDBC specification for allowable mappings from SQL types to Java types with the ResultSet.getXXX methods.
Column names used as input to getXXX methods are case insensitive. When performing a getXXX using a column name, if several columns have the same name, then the value of the first matching column will be returned. The column name option is designed to be used when column names are used in the SQL query. For columns that are NOT explicitly named in the query, it is best to use column numbers. If column names were used there is no way for the programmer to guarantee that they actually refer to the intended columns.
A ResultSet is automatically closed by the Statement that generated it when that Statement is closed, re-executed, or is used to retrieve the next result from a sequence of multiple results.
The number, types and properties of a ResultSet's columns are provided by the ResulSetMetaData object returned by the getMetaData method.
PreparedStatement.executeQuery(java.lang.String),
PreparedStatement.getResultSet(),
ResultSetMetaData| Field Summary | |
protected boolean |
beforefirst
True if we are before the first row. |
protected boolean |
lastNull
True if last value retrieved was null. |
protected Select |
query
Query that generated this result set. |
protected PreparedStatement |
statement
Statement that was used to generate this result set. |
| Fields inherited from interface java.sql.ResultSet |
CONCUR_READ_ONLY, CONCUR_UPDATABLE, FETCH_FORWARD, FETCH_REVERSE, FETCH_UNKNOWN, TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, TYPE_SCROLL_SENSITIVE |
| Constructor Summary | |
protected |
ResultSet(Select query,
PreparedStatement statement)
Constructor. |
| Method Summary | |
boolean |
absolute(int row)
Move to an absolute row number in the result set. |
void |
afterLast()
Moves to the end of the result set, just after the last row. |
void |
beforeFirst()
Moves to the front of the result set, just before the first row. |
void |
cancelRowUpdates()
The cancelRowUpdates() method may be called after calling an updateXXX() method(s) and before calling updateRow() to rollback the updates made to a row. |
void |
clearWarnings()
After this call getWarnings returns null until a new warning is reported for this ResultSet. |
void |
close()
In some cases, it is desirable to immediately release a ResultSet's database and JDBC resources instead of waiting for this to happen when it is automatically closed; the close method provides this immediate release. |
void |
deleteRow()
Delete the current row from the result set and the underlying database. |
int |
findColumn(String columnName)
Map a Resultset column name to a ResultSet column index. |
boolean |
first()
Moves to the first row in the result set. |
Array |
getArray(int i)
Get an array column. |
Array |
getArray(String colName)
Get an array column. |
InputStream |
getAsciiStream(int columnIndex)
A column value can be retrieved as a stream of ASCII characters and then read in chunks from the stream. |
InputStream |
getAsciiStream(String columnName)
A column value can be retrieved as a stream of ASCII characters and then read in chunks from the stream. |
BigDecimal |
getBigDecimal(int columnIndex)
Get the value of a column in the current row as a java.math.BigDecimal object. |
BigDecimal |
getBigDecimal(int columnIndex,
int scale)
Deprecated. |
BigDecimal |
getBigDecimal(String columnName)
Get the value of a column in the current row as a java.math.BigDecimal object. |
BigDecimal |
getBigDecimal(String columnName,
int scale)
Deprecated. |
InputStream |
getBinaryStream(int columnIndex)
A column value can be retrieved as a stream of uninterpreted bytes and then read in chunks from the stream. |
InputStream |
getBinaryStream(String columnName)
A column value can be retrieved as a stream of uninterpreted bytes and then read in chunks from the stream. |
Blob |
getBlob(int i)
Get a BLOB column. |
Blob |
getBlob(String colName)
Get a BLOB column. |
boolean |
getBoolean(int columnIndex)
Get the value of a column in the current row as a Java boolean. |
boolean |
getBoolean(String columnName)
Get the value of a column in the current row as a Java boolean. |
byte |
getByte(int columnIndex)
Get the value of a column in the current row as a Java byte. |
byte |
getByte(String columnName)
Get the value of a column in the current row as a Java byte. |
byte[] |
getBytes(int columnIndex)
Get the value of a column in the current row as a Java byte array. |
byte[] |
getBytes(String columnName)
Get the value of a column in the current row as a Java byte array. |
Reader |
getCharacterStream(int columnIndex)
Get the value of a column in the current row as a java.io.Reader. |
Reader |
getCharacterStream(String columnName)
Get the value of a column in the current row as a java.io.Reader. |
Clob |
getClob(int i)
Get a CLOB column. |
Clob |
getClob(String colName)
Get a CLOB column. |
int |
getConcurrency()
Return the concurrency of this result set. |
String |
getCursorName()
Get the name of the SQL cursor used by this ResultSet. |
Date |
getDate(int columnIndex)
Get the value of a column in the current row as a java.sql.Date object. |
Date |
getDate(int columnIndex,
Calendar cal)
Get the value of a column in the current row as a java.sql.Date object. |
Date |
getDate(String columnName)
Get the value of a column in the current row as a java.sql.Date object. |
Date |
getDate(String columnName,
Calendar cal)
Get the value of a column in the current row as a java.sql.Date object. |
double |
getDouble(int columnIndex)
Get the value of a column in the current row as a Java double. |
double |
getDouble(String columnName)
Get the value of a column in the current row as a Java double. |
int |
getFetchDirection()
Return the fetch direction for this result set. |
int |
getFetchSize()
Return the fetch size for this result set. |
float |
getFloat(int columnIndex)
Get the value of a column in the current row as a Java float. |
float |
getFloat(String columnName)
Get the value of a column in the current row as a Java float. |
int |
getInt(int columnIndex)
Get the value of a column in the current row as a Java int. |
int |
getInt(String columnName)
Get the value of a column in the current row as a Java int. |
long |
getLong(int columnIndex)
Get the value of a column in the current row as a Java long. |
long |
getLong(String columnName)
Get the value of a column in the current row as a Java long. |
ResultSetMetaData |
getMetaData()
The number, types and properties of a ResultSet's columns are provided by the getMetaData method. |
Object |
getObject(int columnIndex)
Get the value of a column in the current row as a Java object. |
Object |
getObject(int i,
Map map)
Returns the value of column @i as a Java object. |
Object |
getObject(String columnName)
Get the value of a column in the current row as a Java object. |
Object |
getObject(String colName,
Map map)
Returns the value of column @i as a Java object. |
Ref |
getRef(int i)
Get a REF(<structured-type>) column. |
Ref |
getRef(String colName)
Get a REF(<structured-type>) column. |
int |
getRow()
Determine the current row number. |
short |
getShort(int columnIndex)
Get the value of a column in the current row as a Java short. |
short |
getShort(String columnName)
Get the value of a column in the current row as a Java short. |
Statement |
getStatement()
Return the Statement that produced the ResultSet. |
String |
getString(int columnIndex)
Get the value of a column in the current row as a Java String. |
String |
getString(String columnName)
Get the value of a column in the current row as a Java String. |
Time |
getTime(int columnIndex)
Get the value of a column in the current row as a java.sql.Time object. |
Time |
getTime(int columnIndex,
Calendar cal)
Get the value of a column in the current row as a java.sql.Time object. |
Time |
getTime(String columnName)
Get the value of a column in the current row as a java.sql.Time object. |
Time |
getTime(String columnName,
Calendar cal)
Get the value of a column in the current row as a java.sql.Time object. |
Timestamp |
getTimestamp(int columnIndex)
Get the value of a column in the current row as a java.sql.Timestamp object. |
Timestamp |
getTimestamp(int columnIndex,
Calendar cal)
Get the value of a column in the current row as a java.sql.Timestamp object. |
Timestamp |
getTimestamp(String columnName)
Get the value of a column in the current row as a java.sql.Timestamp object. |
Timestamp |
getTimestamp(String columnName,
Calendar cal)
Get the value of a column in the current row as a java.sql.Timestamp object. |
int |
getType()
Return the type of this result set. |
InputStream |
getUnicodeStream(int columnIndex)
Deprecated. |
InputStream |
getUnicodeStream(String columnName)
Deprecated. |
SQLWarning |
getWarnings()
The first warning reported by calls on this ResultSet is returned. |
void |
insertRow()
Insert the contents of the insert row into the result set and the database. |
boolean |
isAfterLast()
Determine if the cursor is after the last row in the result set. |
boolean |
isBeforeFirst()
Determine if the cursor is before the first row in the result set. |
boolean |
isFirst()
Determine if the cursor is on the first row of the result set. |
boolean |
isLast()
Determine if the cursor is on the last row of the result set. |
boolean |
last()
Moves to the last row in the result set. |
void |
moveToCurrentRow()
Move the cursor to the remembered cursor position, usually the current row. |
void |
moveToInsertRow()
Move to the insert row. |
boolean |
next()
A ResultSet is initially positioned before its first row; the first call to next makes the first row the current row; the second call makes the second row the current row, etc. |
boolean |
previous()
Moves to the previous row in the result set. |
void |
refreshRow()
Refresh the value of the current row with its current value in the database. |
boolean |
relative(int rows)
Moves a relative number of rows, either positive or negative. |
boolean |
rowDeleted()
Determine if this row has been deleted. |
boolean |
rowInserted()
Determine if the current row has been inserted. |
boolean |
rowUpdated()
Determine if the current row has been updated. |
void |
setFetchDirection(int direction)
Give a hint as to the direction in which the rows in this result set will be processed. |
void |
setFetchSize(int rows)
Give the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed for this result set. |
void |
updateAsciiStream(int columnIndex,
InputStream x,
int length)
Update a column with an ascii stream value. |
void |
updateAsciiStream(String columnName,
InputStream x,
int length)
Update a column with an ascii stream value. |
void |
updateBigDecimal(int columnIndex,
BigDecimal x)
Update a column with a BigDecimal value. |
void |
updateBigDecimal(String columnName,
BigDecimal x)
Update a column with a BigDecimal value. |
void |
updateBinaryStream(int columnIndex,
InputStream x,
int length)
Update a column with a binary stream value. |
void |
updateBinaryStream(String columnName,
InputStream x,
int length)
Update a column with a binary stream value. |
void |
updateBoolean(int columnIndex,
boolean x)
Update a column with a boolean value. |
void |
updateBoolean(String columnName,
boolean x)
Update a column with a boolean value. |
void |
updateByte(int columnIndex,
byte x)
Update a column with a byte value. |
void |
updateByte(String columnName,
byte x)
Update a column with a byte value. |
void |
updateBytes(int columnIndex,
byte[] x)
Update a column with a byte array value. |
void |
updateBytes(String columnName,
byte[] x)
Update a column with a byte array value. |
void |
updateCharacterStream(int columnIndex,
Reader x,
int length)
Update a column with a character stream value. |
void |
updateCharacterStream(String columnName,
Reader reader,
int length)
Update a column with a character stream value. |
void |
updateDate(int columnIndex,
Date x)
Update a column with a Date value. |
void |
updateDate(String columnName,
Date x)
Update a column with a Date value. |
void |
updateDouble(int columnIndex,
double x)
Update a column with a Double value. |
void |
updateDouble(String columnName,
double x)
Update a column with a double value. |
void |
updateFloat(int columnIndex,
float x)
Update a column with a float value. |
void |
updateFloat(String columnName,
float x)
Update a column with a float value. |
void |
updateInt(int columnIndex,
int x)
Update a column with an integer value. |
void |
updateInt(String columnName,
int x)
Update a column with an integer value. |
void |
updateLong(int columnIndex,
long x)
Update a column with a long value. |
void |
updateLong(String columnName,
long x)
Update a column with a long value. |
void |
updateNull(int columnIndex)
Give a nullable column a null value. |
void |
updateNull(String columnName)
Update a column with a null value. |
void |
updateObject(int columnIndex,
Object x)
Update a column with an Object value. |
void |
updateObject(int columnIndex,
Object x,
int scale)
Update a column with an Object value. |
void |
updateObject(String columnName,
Object x)
Update a column with an Object value. |
void |
updateObject(String columnName,
Object x,
int scale)
Update a column with an Object value. |
void |
updateRow()
Update the underlying database with the new contents of the current row. |
void |
updateShort(int columnIndex,
short x)
Update a column with a short value. |
void |
updateShort(String columnName,
short x)
Update a column with a short value. |
void |
updateString(int columnIndex,
String x)
Update a column with a String value. |
void |
updateString(String columnName,
String x)
Update a column with a String value. |
void |
updateTime(int columnIndex,
Time x)
Update a column with a Time value. |
void |
updateTime(String columnName,
Time x)
Update a column with a Time value. |
void |
updateTimestamp(int columnIndex,
Timestamp x)
Update a column with a Timestamp value. |
void |
updateTimestamp(String columnName,
Timestamp x)
Update a column with a Timestamp value. |
boolean |
wasNull()
A column may have the value of SQL NULL; wasNull reports whether the last column read had this special value. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
protected Select query
protected PreparedStatement statement
protected boolean lastNull
protected boolean beforefirst
| Constructor Detail |
protected ResultSet(Select query,
PreparedStatement statement)
query - query to generate result set fromstatement - statement used to execute query| Method Detail |
public boolean next()
throws SQLException
If an input stream from the previous row is open, it is implicitly closed. The ResultSet's warning chain is cleared when a new row is read.
next in interface ResultSetSQLException - if a database-access error occurs.
public void close()
throws SQLException
Note: A ResultSet is automatically closed by the Statement that generated it when that Statement is closed, re-executed, or is used to retrieve the next result from a sequence of multiple results. A ResultSet is also automatically closed when it is garbage collected.
close in interface ResultSetSQLException - if a database-access error occurs.
public boolean wasNull()
throws SQLException
wasNull in interface ResultSetSQLException - if a database-access error occurs.
public Object getObject(int columnIndex)
throws SQLException
Get the value of a column in the current row as a Java object.
This method will return the value of the given column as a Java object. The type of the Java object will be the default Java Object type corresponding to the column's SQL type, following the mapping specified in the JDBC spec.
This method may also be used to read datatabase specific abstract data types.
getObject in interface ResultSetcolumnIndex - the first column is 1, the second is 2, ...SQLException - if a database-access error occurs.
public String getString(int columnIndex)
throws SQLException
getString in interface ResultSetcolumnIndex - the first column is 1, the second is 2, ...SQLException - if a database-access error occurs.
public boolean getBoolean(int columnIndex)
throws SQLException
getBoolean in interface ResultSetcolumnIndex - the first column is 1, the second is 2, ...SQLException - if a database-access error occurs.
public byte getByte(int columnIndex)
throws SQLException
getByte in interface ResultSetcolumnIndex - the first column is 1, the second is 2, ...SQLException - if a database-access error occurs.
public short getShort(int columnIndex)
throws SQLException
getShort in interface ResultSetcolumnIndex - the first column is 1, the second is 2, ...SQLException - if a database-access error occurs.
public int getInt(int columnIndex)
throws SQLException
getInt in interface ResultSetcolumnIndex - the first column is 1, the second is 2, ...SQLException - if a database-access error occurs.
public long getLong(int columnIndex)
throws SQLException
getLong in interface ResultSetcolumnIndex - the first column is 1, the second is 2, ...SQLException - if a database-access error occurs.
public float getFloat(int columnIndex)
throws SQLException
getFloat in interface ResultSetcolumnIndex - the first column is 1, the second is 2, ...SQLException - if a database-access error occurs.
public double getDouble(int columnIndex)
throws SQLException
getDouble in interface ResultSetcolumnIndex - the first column is 1, the second is 2, ...SQLException - if a database-access error occurs.
public BigDecimal getBigDecimal(int columnIndex,
int scale)
throws SQLException
getBigDecimal in interface ResultSetcolumnIndex - the first column is 1, the second is 2, ...scale - the number of digits to the right of the decimalSQLException - if a database-access error occurs.
public byte[] getBytes(int columnIndex)
throws SQLException
getBytes in interface ResultSetcolumnIndex - the first column is 1, the second is 2, ...SQLException - if a database-access error occurs.
public Date getDate(int columnIndex)
throws SQLException
getDate in interface ResultSetcolumnIndex - the first column is 1, the second is 2, ...SQLException - if a database-access error occurs.
public Time getTime(int columnIndex)
throws SQLException
getTime in interface ResultSetcolumnIndex - the first column is 1, the second is 2, ...SQLException - if a database-access error occurs.
public Timestamp getTimestamp(int columnIndex)
throws SQLException
getTimestamp in interface ResultSetcolumnIndex - the first column is 1, the second is 2, ...SQLException - if a database-access error occurs.
public InputStream getAsciiStream(int columnIndex)
throws SQLException
Note: All the data in the returned stream must be read prior to getting the value of any other column. The next call to a get method implicitly closes the stream. . Also, a stream may return 0 for available() whether there is data available or not.
getAsciiStream in interface ResultSetcolumnIndex - the first column is 1, the second is 2, ...SQLException - if a database-access error occurs.
public InputStream getUnicodeStream(int columnIndex)
throws SQLException
Note: All the data in the returned stream must be read prior to getting the value of any other column. The next call to a get method implicitly closes the stream. . Also, a stream may return 0 for available() whether there is data available or not.
getUnicodeStream in interface ResultSetcolumnIndex - the first column is 1, the second is 2, ...SQLException - if a database-access error occurs.
public InputStream getBinaryStream(int columnIndex)
throws SQLException
Note: All the data in the returned stream must be read prior to getting the value of any other column. The next call to a get method implicitly closes the stream. Also, a stream may return 0 for available() whether there is data available or not.
getBinaryStream in interface ResultSetcolumnIndex - the first column is 1, the second is 2, ...SQLException - if a database-access error occurs.
public Object getObject(String columnName)
throws SQLException
Get the value of a column in the current row as a Java object.
This method will return the value of the given column as a Java object. The type of the Java object will be the default Java Object type corresponding to the column's SQL type, following the mapping specified in the JDBC spec.
This method may also be used to read datatabase specific abstract data types.
getObject in interface ResultSetcolumnName - is the SQL name of the columnSQLException - if a database-access error occurs.
public String getString(String columnName)
throws SQLException
getString in interface ResultSetcolumnName - is the SQL name of the columnSQLException - if a database-access error occurs.
public boolean getBoolean(String columnName)
throws SQLException
getBoolean in interface ResultSetcolumnName - is the SQL name of the columnSQLException - if a database-access error occurs.
public byte getByte(String columnName)
throws SQLException
getByte in interface ResultSetcolumnName - is the SQL name of the columnSQLException - if a database-access error occurs.
public short getShort(String columnName)
throws SQLException
getShort in interface ResultSetcolumnName - is the SQL name of the columnSQLException - if a database-access error occurs.
public int getInt(String columnName)
throws SQLException
getInt in interface ResultSetcolumnName - is the SQL name of the columnSQLException - if a database-access error occurs.
public long getLong(String columnName)
throws SQLException
getLong in interface ResultSetcolumnName - is the SQL name of the columnSQLException - if a database-access error occurs.
public float getFloat(String columnName)
throws SQLException
getFloat in interface ResultSetcolumnName - is the SQL name of the columnSQLException - if a database-access error occurs.
public double getDouble(String columnName)
throws SQLException
getDouble in interface ResultSetcolumnName - is the SQL name of the columnSQLException - if a database-access error occurs.
public BigDecimal getBigDecimal(String columnName,
int scale)
throws SQLException
getBigDecimal in interface ResultSetcolumnName - is the SQL name of the columnscale - the number of digits to the right of the decimalSQLException - if a database-access error occurs.
public byte[] getBytes(String columnName)
throws SQLException
getBytes in interface ResultSetcolumnName - is the SQL name of the columnSQLException - if a database-access error occurs.
public Date getDate(String columnName)
throws SQLException
getDate in interface ResultSetcolumnName - is the SQL name of the columnSQLException - if a database-access error occurs.
public Time getTime(String columnName)
throws SQLException
getTime in interface ResultSetcolumnName - is the SQL name of the columnSQLException - if a database-access error occurs.
public Timestamp getTimestamp(String columnName)
throws SQLException
getTimestamp in interface ResultSetcolumnName - is the SQL name of the columnSQLException - if a database-access error occurs.
public InputStream getAsciiStream(String columnName)
throws SQLException
Note: All the data in the returned stream must be read prior to getting the value of any other column. The next call to a get method implicitly closes the stream.
getAsciiStream in interface ResultSetcolumnName - is the SQL name of the columnSQLException - if a database-access error occurs.
public InputStream getUnicodeStream(String columnName)
throws SQLException
Note: All the data in the returned stream must be read prior to getting the value of any other column. The next call to a get method implicitly closes the stream.
getUnicodeStream in interface ResultSetcolumnName - is the SQL name of the columnSQLException - if a database-access error occurs.
public InputStream getBinaryStream(String columnName)
throws SQLException
Note: All the data in the returned stream must be read prior to getting the value of any other column. The next call to a get method implicitly closes the stream.
getBinaryStream in interface ResultSetcolumnName - is the SQL name of the columnSQLException - if a database-access error occurs.
public SQLWarning getWarnings()
throws SQLException
The first warning reported by calls on this ResultSet is returned. Subsequent ResultSet warnings will be chained to this SQLWarning.
The warning chain is automatically cleared each time a new row is read.
Note: This warning chain only covers warnings caused by ResultSet methods. Any warning caused by statement methods (such as reading OUT parameters) will be chained on the Statement object.
getWarnings in interface ResultSetSQLException - if a database-access error occurs.
public void clearWarnings()
throws SQLException
clearWarnings in interface ResultSetSQLException - if a database-access error occurs.
public String getCursorName()
throws SQLException
In SQL, a result table is retrieved through a cursor that is named. The current row of a result can be updated or deleted using a positioned update/delete statement that references the cursor name.
JDBC supports this SQL feature by providing the name of the SQL cursor used by a ResultSet. The current row of a ResultSet is also the current row of this SQL cursor.
Note: If positioned update is not supported a SQLException is thrown
getCursorName in interface ResultSetSQLException - if a database-access error occurs.
public ResultSetMetaData getMetaData()
throws SQLException
getMetaData in interface ResultSetSQLException - if a database-access error occurs.
public int findColumn(String columnName)
throws SQLException
findColumn in interface ResultSetcolumnName - the name of the columnSQLException - if a database-access error occurs.
public Reader getCharacterStream(int columnIndex)
throws SQLException
Get the value of a column in the current row as a java.io.Reader.
getCharacterStream in interface ResultSet
public Reader getCharacterStream(String columnName)
throws SQLException
Get the value of a column in the current row as a java.io.Reader.
getCharacterStream in interface ResultSet
public BigDecimal getBigDecimal(int columnIndex)
throws SQLException
getBigDecimal in interface ResultSetcolumnIndex - the first column is 1, the second is 2, ...SQLException - if a database-access error occurs.
public BigDecimal getBigDecimal(String columnName)
throws SQLException
getBigDecimal in interface ResultSet
public boolean isBeforeFirst()
throws SQLException
Determine if the cursor is before the first row in the result set.
isBeforeFirst in interface ResultSetSQLException - if a database-access error occurs.
public boolean isAfterLast()
throws SQLException
Determine if the cursor is after the last row in the result set.
isAfterLast in interface ResultSetSQLException - if a database-access error occurs.
public boolean isFirst()
throws SQLException
Determine if the cursor is on the first row of the result set.
isFirst in interface ResultSetSQLException - if a database-access error occurs.
public boolean isLast()
throws SQLException
Determine if the cursor is on the last row of the result set. Note: Calling isLast() may be expensive since the JDBC driver might need to fetch ahead one row in order to determine whether the current row is the last row in the result set.
isLast in interface ResultSetSQLException - if a database-access error occurs.
public void beforeFirst()
throws SQLException
Moves to the front of the result set, just before the first row. Has no effect if the result set contains no rows.
beforeFirst in interface ResultSetSQLException - if a database-access error occurs, or
result set type is TYPE_FORWARD_ONLY
public void afterLast()
throws SQLException
Moves to the end of the result set, just after the last row. Has no effect if the result set contains no rows.
afterLast in interface ResultSetSQLException - if a database-access error occurs, or
result set type is TYPE_FORWARD_ONLY.
public boolean first()
throws SQLException
Moves to the first row in the result set.
first in interface ResultSetSQLException - if a database-access error occurs, or
result set type is TYPE_FORWARD_ONLY.
public boolean last()
throws SQLException
Moves to the last row in the result set.
last in interface ResultSetSQLException - if a database-access error occurs, or
result set type is TYPE_FORWARD_ONLY.
public int getRow()
throws SQLException
Determine the current row number. The first row is number 1, the second number 2, etc.
getRow in interface ResultSetSQLException - if a database-access error occurs.
public boolean absolute(int row)
throws SQLException
Move to an absolute row number in the result set.
If row is positive, moves to an absolute row with respect to the beginning of the result set. The first row is row 1, the second is row 2, etc.
If row is negative, moves to an absolute row position with respect to the end of result set. For example, calling absolute(-1) positions the cursor on the last row, absolute(-2) indicates the next-to-last row, etc.
An attempt to position the cursor beyond the first/last row in the result set, leaves the cursor before/after the first/last row, respectively.
Note: Calling absolute(1) is the same as calling first(). Calling absolute(-1) is the same as calling last().
absolute in interface ResultSetSQLException - if a database-access error occurs, or
row is 0, or result set type is TYPE_FORWARD_ONLY.
public boolean relative(int rows)
throws SQLException
Moves a relative number of rows, either positive or negative. Attempting to move beyond the first/last row in the result set positions the cursor before/after the the first/last row. Calling relative(0) is valid, but does not change the cursor position.
Note: Calling relative(1) is different than calling next() since is makes sense to call next() when there is no current row, for example, when the cursor is positioned before the first row or after the last row of the result set.
relative in interface ResultSetSQLException - if a database-access error occurs, or there
is no current row, or result set type is TYPE_FORWARD_ONLY.
public boolean previous()
throws SQLException
Moves to the previous row in the result set.
Note: previous() is not the same as relative(-1) since it makes sense to call previous() when there is no current row.
previous in interface ResultSetSQLException - if a database-access error occurs, or
result set type is TYPE_FORWAR_DONLY.
public void setFetchDirection(int direction)
throws SQLException
setFetchDirection in interface ResultSetSQLException - if a database-access error occurs, or
the result set type is TYPE_FORWARD_ONLY and direction is not
FETCH_FORWARD.
public int getFetchDirection()
throws SQLException
getFetchDirection in interface ResultSetSQLException - if a database-access error occurs
public void setFetchSize(int rows)
throws SQLException
setFetchSize in interface ResultSetrows - the number of rows to fetchSQLException - if a database-access error occurs, or the
condition 0 <= rows <= this.getMaxRows() is not satisfied.
public int getFetchSize()
throws SQLException
getFetchSize in interface ResultSetSQLException - if a database-access error occurs
public int getType()
throws SQLException
getType in interface ResultSetSQLException - if a database-access error occurs
public int getConcurrency()
throws SQLException
getConcurrency in interface ResultSetSQLException - if a database-access error occurs
public boolean rowUpdated()
throws SQLException
rowUpdated in interface ResultSetSQLException - if a database-access error occursDatabaseMetaData.updatesAreDetected(int)
public boolean rowInserted()
throws SQLException
rowInserted in interface ResultSetSQLException - if a database-access error occursDatabaseMetaData.insertsAreDetected(int)
public boolean rowDeleted()
throws SQLException
rowDeleted in interface ResultSetSQLException - if a database-access error occursDatabaseMetaData.deletesAreDetected(int)
public void updateNull(int columnIndex)
throws SQLException
updateNull in interface ResultSetcolumnIndex - the first column is 1, the second is 2, ...SQLException - if a database-access error occurs
public void updateBoolean(int columnIndex,
boolean x)
throws SQLException
updateBoolean in interface ResultSetcolumnIndex - the first column is 1, the second is 2, ...x - the new column valueSQLException - if a database-access error occurs
public void updateByte(int columnIndex,
byte x)
throws SQLException
updateByte in interface ResultSetcolumnIndex - the first column is 1, the second is 2, ...x - the new column valueSQLException - if a database-access error occurs
public void updateShort(int columnIndex,
short x)
throws SQLException
updateShort in interface ResultSetcolumnIndex - the first column is 1, the second is 2, ...x - the new column valueSQLException - if a database-access error occurs
public void updateInt(int columnIndex,
int x)
throws SQLException
updateInt in interface ResultSetcolumnIndex - the first column is 1, the second is 2, ...x - the new column valueSQLException - if a database-access error occurs
public void updateLong(int columnIndex,
long x)
throws SQLException
updateLong in interface ResultSetcolumnIndex - the first column is 1, the second is 2, ...x - the new column valueSQLException - if a database-access error occurs
public void updateFloat(int columnIndex,
float x)
throws SQLException
updateFloat in interface ResultSetcolumnIndex - the first column is 1, the second is 2, ...x - the new column valueSQLException - if a database-access error occurs
public void updateDouble(int columnIndex,
double x)
throws SQLException
updateDouble in interface ResultSetcolumnIndex - the first column is 1, the second is 2, ...x - the new column valueSQLException - if a database-access error occurs
public void updateBigDecimal(int columnIndex,
BigDecimal x)
throws SQLException
updateBigDecimal in interface ResultSetcolumnIndex - the first column is 1, the second is 2, ...x - the new column valueSQLException - if a database-access error occurs
public void updateString(int columnIndex,
String x)
throws SQLException
updateString in interface ResultSetcolumnIndex - the first column is 1, the second is 2, ...x - the new column valueSQLException - if a database-access error occurs
public void updateBytes(int columnIndex,
byte[] x)
throws SQLException
updateBytes in interface ResultSetcolumnIndex - the first column is 1, the second is 2, ...x - the new column valueSQLException - if a database-access error occurs
public void updateDate(int columnIndex,
Date x)
throws SQLException
updateDate in interface ResultSetcolumnIndex - the first column is 1, the second is 2, ...x - the new column valueSQLException - if a database-access error occurs
public void updateTime(int columnIndex,
Time x)
throws SQLException
updateTime in interface ResultSetcolumnIndex - the first column is 1, the second is 2, ...x - the new column valueSQLException - if a database-access error occurs
public void updateTimestamp(int columnIndex,
Timestamp x)
throws SQLException
updateTimestamp in interface ResultSetcolumnIndex - the first column is 1, the second is 2, ...x - the new column valueSQLException - if a database-access error occurs
public void updateAsciiStream(int columnIndex,
InputStream x,
int length)
throws SQLException
updateAsciiStream in interface ResultSetcolumnIndex - the first column is 1, the second is 2, ...x - the new column valuelength - the length of the streamSQLException - if a database-access error occurs
public void updateBinaryStream(int columnIndex,
InputStream x,
int length)
throws SQLException
updateBinaryStream in interface ResultSetcolumnIndex - the first column is 1, the second is 2, ...x - the new column valuelength - the length of the streamSQLException - if a database-access error occurs
public void updateCharacterStream(int columnIndex,
Reader x,
int length)
throws SQLException
updateCharacterStream in interface ResultSetcolumnIndex - the first column is 1, the second is 2, ...x - the new column valuelength - the length of the streamSQLException - if a database-access error occurs
public void updateObject(int columnIndex,
Object x,
int scale)
throws SQLException
updateObject in interface ResultSetcolumnIndex - the first column is 1, the second is 2, ...x - the new column valuescale - For java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types
this is the number of digits after the decimal. For all other
types this value will be ignored.SQLException - if a database-access error occurs
public void updateObject(int columnIndex,
Object x)
throws SQLException
updateObject in interface ResultSetcolumnIndex - the first column is 1, the second is 2, ...x - the new column valueSQLException - if a database-access error occurs
public void updateNull(String columnName)
throws SQLException
updateNull in interface ResultSetcolumnName - the name of the columnSQLException - if a database-access error occurs
public void updateBoolean(String columnName,
boolean x)
throws SQLException
updateBoolean in interface ResultSetcolumnName - the name of the columnx - the new column valueSQLException - if a database-access error occurs
public void updateByte(String columnName,
byte x)
throws SQLException
updateByte in interface ResultSetcolumnName - the name of the columnx - the new column valueSQLException - if a database-access error occurs
public void updateShort(String columnName,
short x)
throws SQLException
updateShort in interface ResultSetcolumnName - the name of the columnx - the new column valueSQLException - if a database-access error occurs
public void updateInt(String columnName,
int x)
throws SQLException
updateInt in interface ResultSetcolumnName - the name of the columnx - the new column valueSQLException - if a database-access error occurs
public void updateLong(String columnName,
long x)
throws SQLException
updateLong in interface ResultSetcolumnName - the name of the columnx - the new column valueSQLException - if a database-access error occurs
public void updateFloat(String columnName,
float x)
throws SQLException
updateFloat in interface ResultSetcolumnName - the name of the columnx - the new column valueSQLException - if a database-access error occurs
public void updateDouble(String columnName,
double x)
throws SQLException
updateDouble in interface ResultSetcolumnName - the name of the columnx - the new column valueSQLException - if a database-access error occurs
public void updateBigDecimal(String columnName,
BigDecimal x)
throws SQLException
updateBigDecimal in interface ResultSetcolumnName - the name of the columnx - the new column valueSQLException - if a database-access error occurs
public void updateString(String columnName,
String x)
throws SQLException
updateString in interface ResultSetcolumnName - the name of the columnx - the new column valueSQLException - if a database-access error occurs
public void updateBytes(String columnName,
byte[] x)
throws SQLException
updateBytes in interface ResultSetcolumnName - the name of the columnx - the new column valueSQLException - if a database-access error occurs
public void updateDate(String columnName,
Date x)
throws SQLException
updateDate in interface ResultSetcolumnName - the name of the columnx - the new column valueSQLException - if a database-access error occurs
public void updateTime(String columnName,
Time x)
throws SQLException
updateTime in interface ResultSetcolumnName - the name of the columnx - the new column valueSQLException - if a database-access error occurs
public void updateTimestamp(String columnName,
Timestamp x)
throws SQLException
updateTimestamp in interface ResultSetcolumnName - the name of the columnx - the new column valueSQLException - if a database-access error occurs
public void updateAsciiStream(String columnName,
InputStream x,
int length)
throws SQLException
updateAsciiStream in interface ResultSetcolumnName - the name of the columnx - the new column valuelength - of the streamSQLException - if a database-access error occurs
public void updateBinaryStream(String columnName,
InputStream x,
int length)
throws SQLException
updateBinaryStream in interface ResultSetcolumnName - the name of the columnx - the new column valuelength - of the streamSQLException - if a database-access error occurs
public void updateCharacterStream(String columnName,
Reader reader,
int length)
throws SQLException
updateCharacterStream in interface ResultSetcolumnName - the name of the columnx - the new column valuelength - of the streamSQLException - if a database-access error occurs
public void updateObject(String columnName,
Object x,
int scale)
throws SQLException
updateObject in interface ResultSetcolumnName - the name of the columnx - the new column valuescale - For java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types
this is the number of digits after the decimal. For all other
types this value will be ignored.SQLException - if a database-access error occurs
public void updateObject(String columnName,
Object x)
throws SQLException
updateObject in interface ResultSetcolumnName - the name of the columnx - the new column valueSQLException - if a database-access error occurs
public void insertRow()
throws SQLException
insertRow in interface ResultSetSQLException - if a database-access error occurs,
if called when not on the insert row, or if all non-nullable columns in
the insert row have not been given a value
public void updateRow()
throws SQLException
updateRow in interface ResultSetSQLException - if a database-access error occurs, or
if called when on the insert row
public void deleteRow()
throws SQLException
deleteRow in interface ResultSetSQLException - if a database-access error occurs, or if
called when on the insert row.
public void refreshRow()
throws SQLException
refreshRow in interface ResultSetSQLException - if a database-access error occurs, or if
called when on the insert row.
public void cancelRowUpdates()
throws SQLException
cancelRowUpdates in interface ResultSetSQLException - if a database-access error occurs, or if
called when on the insert row.
public void moveToInsertRow()
throws SQLException
moveToInsertRow in interface ResultSetSQLException - if a database-access error occurs,
or the result set is not updatable
public void moveToCurrentRow()
throws SQLException
moveToCurrentRow in interface ResultSetSQLException - if a database-access error occurs,
or the result set is not updatable
public Statement getStatement()
throws SQLException
getStatement in interface ResultSetSQLException - if a database-access error occurs
public Object getObject(int i,
Map map)
throws SQLException
getObject in interface ResultSeti - the first column is 1, the second is 2, ...map - the mapping from SQL type names to Java classes
public Ref getRef(int i)
throws SQLException
getRef in interface ResultSeti - the first column is 1, the second is 2, ...
public Blob getBlob(int i)
throws SQLException
getBlob in interface ResultSeti - the first column is 1, the second is 2, ...
public Clob getClob(int i)
throws SQLException
getClob in interface ResultSeti - the first column is 1, the second is 2, ...
public Array getArray(int i)
throws SQLException
getArray in interface ResultSeti - the first column is 1, the second is 2, ...
public Object getObject(String colName,
Map map)
throws SQLException
getObject in interface ResultSetcolName - the column namemap - the mapping from SQL type names to Java classes
public Ref getRef(String colName)
throws SQLException
getRef in interface ResultSetcolName - the column name
public Blob getBlob(String colName)
throws SQLException
getBlob in interface ResultSetcolName - the column name
public Clob getClob(String colName)
throws SQLException
getClob in interface ResultSetcolName - the column name
public Array getArray(String colName)
throws SQLException
getArray in interface ResultSetcolName - the column name
public Date getDate(int columnIndex,
Calendar cal)
throws SQLException
getDate in interface ResultSetcolumnIndex - the first column is 1, the second is 2, ...cal - the calendar to use in constructing the dateSQLException - if a database-access error occurs.
public Date getDate(String columnName,
Calendar cal)
throws SQLException
getDate in interface ResultSetcolumnName - is the SQL name of the columncal - the calendar to use in constructing the dateSQLException - if a database-access error occurs.
public Time getTime(int columnIndex,
Calendar cal)
throws SQLException
getTime in interface ResultSetcolumnIndex - the first column is 1, the second is 2, ...cal - the calendar to use in constructing the timeSQLException - if a database-access error occurs.
public Time getTime(String columnName,
Calendar cal)
throws SQLException
getTime in interface ResultSetcolumnName - is the SQL name of the columncal - the calendar to use in constructing the timeSQLException - if a database-access error occurs.
public Timestamp getTimestamp(int columnIndex,
Calendar cal)
throws SQLException
getTimestamp in interface ResultSetcolumnIndex - the first column is 1, the second is 2, ...cal - the calendar to use in constructing the timestampSQLException - if a database-access error occurs.
public Timestamp getTimestamp(String columnName,
Calendar cal)
throws SQLException
getTimestamp in interface ResultSetcolumnName - is the SQL name of the columncal - the calendar to use in constructing the timestampSQLException - if a database-access error occurs.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||