I discussed this with Bernt just now, and found the following in the JDBC 4 spec to be of interest as well:

------8<------
The three different ResultSet types are described below.
1. TYPE_FORWARD_ONLY The result set is not scrollable; its cursor moves forward only, from before the first row to after the last row. The rows contained in the result set depend on how the underlying database materializes the results. That is, it contains the rows that satisfy the query at either the time the query is executed or as the rows are retrieved.

2. TYPE_SCROLL_INSENSITIVE The result set is scrollable; its cursor can move both forward and backward relative to the current position, and it can move to an absolute position.

The result set is insensitive to changes made to the underlying data source while it is open. It contains the rows that satisfy the query at either the time the query is executed or as the rows are retrieved.

3. TYPE_SCROLL_SENSITIVE The result set is scrollable; its cursor can move both forward and backward relative to the current position, and it can move to an absolute position. The result set reflects changes made to the underlying data source while the result set remains open. The default ResultSet type is TYPE_FORWARD_ONLY.
------>8------

It looks like the default behavior (TYPE_FORWARD_ONLY) is more or less the same as SQL ASENSITIVE. "That is, it contains the rows that satisfy the query ... as the rows are retrieved" should allow different results when index and scan are used.

--
Jørgen Løland

Reply via email to