question: public static boolean nonemptyQueryResult ( ResultSet R ) { logger . trace ( "nonemptyQueryResult(R)" ) ; boolean nonEmpty = false ; if ( R == null ) { return false ; } try { if ( R . getRow ( ) != 0 ) { nonEmpty = true ; } else { logger . trace ( "nonemptyQueryResult(R) - check R.first()..." ) ; nonEmpty = R . first ( ) ; R . beforeFirst ( ) ; } } catch ( Throwable t ) { surfaceThrowable ( "nonemptyQueryResult()" , t ) ; } return nonEmpty ; }
target:  Since the ResultSet class mysteriously lacks a "size()" method, and since simply iterating thru what might be a large ResultSet could be a costly exercise, we play the following games. We take care to try and leave R as we found it, cursor-wise.