Scrollable result set for multiple rows

The Scrollable ResultSet fetches one row at a time from the server. A performance enhancement for Scrollable ResultSet allows multiple rows to be fetched at one time. In the following example, where the rows m through n are desired, the following fetches the rows into a ResultSet. As long as only rows between m and n inclusive are accessed, no further fetches occur. In this example, the rows 50 through 100 are desired and the ResultSet is SCROLL_INSENSITIVE:
 rs.setFetchSize(51);
         rs.absolute(49); // one row will be fetched
         rs.next() // rs will contain 51 rows

HCL OneDB™ only fetches in the forward direction and only fetches one row, except when a DIR_NEXT fetch is used to fetch rows. For a DIR_NEXT operation, the server sends rows until the fetch buffer is filled or until the last row is sent. Only ResultSet.next() can generate a DIR_NEXT operation.

This performance enhancement does not change the behavior of FORWARD_ONLY ResultSets. The calculation of the size of the fetch buffer is unchanged.

For SCROLL_INSENTIVE ResultSets, the size of the fetch buffer is determined by the fetch size and row size. Statement.setFetchSize() and ResultSet.setFetchSize() can be used to set the fetch size. If fetch size is zero, the default fetch buffer size is used. The fetch buffer size is limited to 32 K.

Certain ResultSet methods require information about the number of rows generated by the query. The methods might result in fetching a row to obtain the information and then refetching the current row. The methods are isBeforeFirst(), isLast(), and absolute(-row).

Additionally, setMaxRows() can change the fetch buffer size for SCROLL_INSENSITIVE ResultsSets. Because additional server support is required to ensure efficient use of setMaxRows(), it is recommended that ResultSet.setMaxRows() is not used as this time.