GEOMETRY
GEOMETRY#
This section offers instructions on how to use GEOMETRY type data provided by Altibase in JDBC applications.
How To Use GEOMETRY#
GEOMETRY type data can be used with the byte array in Altibase JDBC applications.
When inserting data(including NULL) to a GEOMETRY type column in the database with the IN parameter of PreparedStatement, the data type must be specified with the AltibaseTypes.GEOMETRY constant.
For more detailed information on how to directly write GEOMETRY type data in a query statement, please refer to Spatial SQL Reference.
Examples#
The following is code example which inserts data to a GEOMETRY type column in a JDBC application.
int sSize = ... ;
byte[] sGeometryData = new byte[sSize];
Connection sConn = ... ;
PreparedStatement sPstmt = sConn.prepareStatement("INSERT INTO TEST_TABLE VALUES (?)");
sPstmt.setObject(1, sGeometryData, AltibaseTypes.GEOMETRY);
sPstmt.executeQuery();
...