-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
H2 returns a detailed description of the Geometry data type related to its geometry type and srid.
e.g : GEOMETRY(POINT Z) , GEOMETRY(POINT Z, 4326)...
This description causes some troubles when we want to link a table from one H2 db to another H2 db.
Pseudo unit test
Connection connectionTarget = ...
Connection linkedDBConnection = ...
Statement statementLinked = linkedDBConnection.createStatement();
statementLinked.execute("DROP TABLE IF EXISTS table_to_link;" );
statementLinked.execute("CREATE TABLE table_to_link ( the_geom GEOMETRY, the_geom2 GEOMETRY(POINT Z)," +
"ID INTEGER, TEMPERATURE DOUBLE PRECISION, LANDCOVER VARCHAR)");
statementLinked.execute("INSERT INTO table_to_link VALUES ('POINT(0 0)', 'POINT(1 1 0)', 1, 2.3, 'Simple points')"+
",('POINT(0 1 2)', 'POINT(10 11 12)', 2, 0.568, '3D point')");
Statement stat = connectionTarget.createStatement();
stat.execute("CREATE LINKED TABLE LINKED_TABLE('org.h2.Driver', 'jdbc:h2:./target/test-resources/dbH2RegressionTest_linked_db', 'sa', 'sa', 'table_to_link') FETCH_SIZE 100 ");returns the following error
Unknown data type: "THE_GEOM2"; SQL statement:
The involved method is :
| int type = DataType.getValueTypeFromResultSet(rsMeta, i + 1); |
Metadata
Metadata
Assignees
Labels
No labels