code: public void insertGeometry( String tableName, Geometry geometry, String epsg ) throws Exception {
          String epsgStr = "4326";
          if (epsg == null) {
              epsgStr = epsg;
          }
  
          GeometryColumn gc = getGeometryColumnsForTable(tableName);
          String sql = "INSERT INTO " + tableName + " (" + gc.geometryColumnName + ") VALUES (ST_GeomFromText(?, " + epsgStr + "))";
  
          execOnConnection(connection -> {
              try (IHMPreparedStatement pStmt = connection.prepareStatement(sql)) {
                  pStmt.setString(1, geometry.toText());
                  pStmt.executeUpdate();
              }
              return null;
          });
  
      }
docs: Insert a geometry into a table.
  
  @param tableName
  the table to use.
  @param geometry
  the geometry to insert.
  @param epsg
  the optional epsg.
  @throws Exception