code: public static boolean hasGeometryField(ResultSet resultSet) throws SQLException {
          ResultSetMetaData meta = resultSet.getMetaData();
          int columnCount = meta.getColumnCount();
          for (int i = 1; i <= columnCount; i++) {
              if (meta.getColumnTypeName(i).equalsIgnoreCase("geometry")) {
                  return true;
              }
          }
          return false;
      }
docs: Check if the ResultSet contains a geometry field
  
  @param resultSet ResultSet to analyse
  
  @return True if the ResultSet contains one geometry field
  
  @throws SQLException