code: public static List<String> getGeometryFields(ResultSet resultSet) throws SQLException {
          List<String> fieldsName = new LinkedList<>();
          ResultSetMetaData meta = resultSet.getMetaData();
          int columnCount = meta.getColumnCount();
          for (int i = 1; i <= columnCount; i++) {
              if (meta.getColumnTypeName(i).equalsIgnoreCase("geometry")) {
                  fieldsName.add(meta.getColumnName(i));
              }
          }
          return fieldsName;
      }
docs: Find geometry fields name of a resultSet.
  
  @param resultSet ResultSet to analyse
  
  @return A list of Geometry fields name
  
  @throws SQLException