if (rs == null) return -1;  try { int currentRow = rs.getRow();  try { rs.last(); return rs.getRow(); } catch (Exception e) { log.log(Level.FINE, e.toString(), e); return -1; } finally { if (currentRow == 0) rs.beforeFirst(); else rs.absolute(currentRow); }  } catch (SQLException e) { log.log(Level.FINE, e.toString(), e); return -1; }
return getNumRows(_rs);
  public static int getNumRows(ResultSet rs)  {    if (rs == null)      return -1;    try {      int currentRow = rs.getRow();      try {        rs.last();        return rs.getRow();      } catch (Exception e) {        log.log(Level.FINE, e.toString(), e);        return -1;      } finally {        if (currentRow == 0)          rs.beforeFirst();        else          rs.absolute(currentRow);      }    } catch (SQLException e) {      log.log(Level.FINE, e.toString(), e);      return -1;    }  }