H2内存数据库错误“使用GEOMETRY时发生数据转换错误”(JdbcSQLException:数据转换错误转换)

时间:2020-04-13 16:40:51

标签: h2 geojson in-memory-database embedded-database

将GeoJson加载到H2表中时,出现以下错误。 请帮忙。

a8155d5f4049c052934acaff7ff80000000000007371007e0020bfc3e16d6dc1a47b4049c054477ff1527ff8000000000000' (CZONE: THE_GEOM GEOMETRY
)"; SQL statement:
**INSERT INTO "CZONE" VALUES(?,?,?,?) -- (?1, ?2, ?3, ?4)** [22018-196]; SQL statement:
CALL GeoJsonRead('/usr/local/javaapp/test/conf/delhicongestionchargezone.geojson', 'CZONE') [22018-196]
**org.h2.jdbc.JdbcSQLException: Data conversion error converting "X'aced0005737200216f72672e**

.......

INSERT INTO "CZONE" VALUES(?,?,?,?) -- (?1, ?2, ?3, ?4) [22018-196]; SQL statement:
**CALL GeoJsonRead**('/usr/local/javaapp/test/conf/delhicongestionchargezone.geojson', 'CZONE') [22018-196]
        at org.h2.message.DbException.addSQL(DbException.java:132)
        at org.h2.command.Command.executeQuery(Command.java:219)
        at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:186)
        at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:164)
        at com.apex.exception.batch.event.TestBatchEvtZone.testGISCall(TestBatchEvtZone.java:1660)
        at com.apex.exception.batch.event.TestBatchEvtZone.processDelhiZoneEvent(TestBatchEvtZone.java:238)
        at com.apex.exception.batch.event.TestBatchEvtZone.processEvent(TestBatchEvtZone.java:208)
        at com.apex.exception.batch.processor.TestBatchEventProcessor$1.call(TestBatchEventProcessor.java:298)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: org.h2.jdbc.JdbcBatchUpdateException: Data conversion error converting "X'aced0005737200216f72672e6

代码段


 stmt.execute("CREATE ALIAS IF NOT EXISTS H2GIS_SPATIAL FOR \"org.h2gis.functions.factory.H2GISFunctions.load\"" );
 stmt.execute("CALL H2GIS_SPATIAL()");
 stmt.execute("CALL GeoJsonRead('/usr/local/javaapp/test/conf/delhicongestionchargezone.geojson', 'CZONE')");

0 个答案:

没有答案