Database Product-Specific Information

JEQL database commands require product-specific components and configuration to be used with any particular database. This page summarizes the information required to configure and use specific database products with JEQL. The information includes:

Driver JAR The name of the JAR file which provides the database driver. Database drivers are generally provided by the product vendor, code project, by third parties, or by associated projects. This JAR file must be obtained and placed in the JEQL_HOME/lib directory.
Driver Class The classname to be used in the driver: parameter
URL Format The format for the URL used to specify the database host and instance in the url: parameter.
Geometry Reading Examples of SQL to read geometry in WKT and WKB format
Geometry Writing Examples of SQL to write geometry supplied in WKT and WKB format
Resources Links to further resources for the database product

H2

Driver JAR h2.jar
Driver Class org.h2.Driver
URL Format Remote using TCP/IP - jdbc:h2:tcp:// hostname : port / [ path ] table-name
Example: jdbc:h2:tcp://localhost/~/test
Resources Product Website
Database URL Specifications

Oracle

Driver JAR ojdbc14.jar
classes12.zip (Older)
Driver Class oracle.jdbc.driver.OracleDriver
URL Format jdbc:oracle:thin:@ hostname : port : instance-name
Example: jdbc:oracle:thin:@localhost:1521:xe

PostgresQL / PostGIS

Driver JAR postgresql-8.3-603.jdbc3.jar
Driver Class org.postgresql.Driver
URL Format jdbc:postgresql:// hostname : port / instance-name
Geometry Writing From WKT: INSERT INTO tbl-name (geomcol) VALUES (ST_GeometryFromText(?, 3005) )
From WKB: INSERT INTO tbl-name (geomcol) VALUES (ST_GeomFromWKB(?, 3005) )

Microsoft Sql Server

Driver JAR sqljdbc.jar
Driver Class com.microsoft.sqlserver.jdbc.SQLServerDriver
URL Format jdbc:sqlserver:// hostname ;database= instance-name ;
Example: jdbc:sqlserver://vm-test;database=Test;
Geometry Writing From WKT:
INSERT INTO tbl-name (geomcol) VALUES (geometry::STPolyFromText(?, 3005) )
From WKB:
INSERT INTO tbl-name (geomcol) VALUES (geometry::STGeomFromWKB(CONVERT(varbinary(max), ?, 2), 3005) )

SQLite

Various Java drivers are available for SQLlite. The following describes the Xerial driver.

Driver JAR sqlite-jdbc-3.7.2.jar
Driver Class org.sqlite.JDBC
URL Format File: jdbc:sqlite:filepath
Example: jdbc:sqlite:C:/sample.db
Resources Driver Website