Workaround for exception thrown by ResultSet#beforeFirst(): "Operation not allowed for a result set of type ResultSet.TYPE_FORWARD_ONLY"