Scrollable result set for multiple rows
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.