How can I find out if the next call to ResultSet.next()
will fetch more rows from the database?
I could set the fetch size (e.g. ResultSet.setFetchSize(1000)
) and then check if ResultSet.getRow()
is a multiple of the fetch size (e.g. 1000).
This is cumbersome if the code is trying to auto-tune the fetch size to maximize row processing speed. In other words, the fetch size may not be constant.
Note: I am using an Oracle database. However, a solution for any database would be nice but not required.