Oracle8i JDBC Developer's Guide and Reference Release 3 (8.1.7) Part Number A83724-01 |
Library | Service | Contents | Index

## Refetching Rows

The result set `refreshRow()` method is supported for some types of result sets for refetching data. This consists of going back to the database to re-obtain the database rows that correspond to N rows in the result set, starting with the current row, where N is the fetch size (described above in "Fetch Size"). This lets you see the latest updates to the database that were made outside of your result set, subject to the isolation level of the enclosing transaction.

Because refetching re-obtains only rows that correspond to rows already in your result set, it does nothing about rows that have been inserted or deleted in the database since the original query. It ignores rows that have been inserted, and rows will remain in your result set even after the corresponding rows have been deleted from the database. When there is an attempt to refetch a row that has been deleted in the database, the corresponding row in the result set will maintain its original values.

Following is the `refreshRow()` method signature:

- `void refreshRow() throws SQLException`

You must be at a valid current row when you call this method, not outside the row bounds and not at the insert-row.

With Oracle8i release 8.1.6 and higher, the `refreshRow()` method is supported for the following result set categories:

- scroll-sensitive/read-only

- scroll-sensitive/updatable

- scroll-insensitive/updatable

Oracle JDBC might support additional result set categories in future releases.

For a code sample that explicitly refetches data using the `refreshRow()` method, see "Refetching Rows in a Result Set--ResultSet6.java".

Note: Scroll-sensitive result set functionality is implemented through implicit calls to `refreshRow()`. See "Oracle Implementation of Scroll-Sensitive Result Sets" for details.

| Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
Library | Service | Contents | Index