code: public static Envelope getResultSetEnvelope(ResultSet resultSet) throws SQLException {
          List<String> geometryFields = getGeometryFields(resultSet);
          if (geometryFields.isEmpty()) {
              throw new SQLException("This ResultSet doesn't contain any geometry field.");
          } else {
              return getResultSetEnvelope(resultSet, geometryFields.get(0));
          }
      }
docs: Compute the full extend of a ResultSet using the first geometry field. If
  the ResultSet does not contain any geometry field throw an exception
  
  @param resultSet ResultSet to analyse
  
  @return The full envelope of the ResultSet
  
  @throws SQLException