code: private static String getFirstGeometryField(String tableName, Connection connection) throws SQLException {
          // Find first geometry column
          List<String> geomFields = SFSUtilities.getGeometryFields(connection, TableLocation.parse(tableName, JDBCUtilities.isH2DataBase(connection.getMetaData())));
          if (!geomFields.isEmpty()) {
              return geomFields.get(0);
          } else {
              throw new SQLException("The table " + tableName + " does not contain a geometry field");
          }
      }
docs: Return the first spatial geometry field name
  
  @param tableName
  @param connection
  @return the name of the first geometry column
  @throws SQLException