[postgis-devel] JDBC updates

Markus Schaber schabios at logi-track.com
Wed Jan 19 02:50:05 PST 2005


Hi, Paul,

(Somehow there are lots of Pauls around here - slightly confusing :-)

Paul Hastings schrieb:
> another stupid question but how does this JDBC driver fit into the
> overall scheme of things?

JDBC is an database driver specification for Java. Nearly all SQL
drivers more or less adhere to the JDBC specification, this allows JDBC
conformant applications to work with every database that provides an
JDBC compliant driver, without any source code changes. This is somehow
similar to ODBC in the C world, if you know this.

The purpose of the JDBC Driver extension is to give the PostgreSQL JDBC
driver some understanding of the PostGIS data types (Geometry, Box3D,
Box2D). Without this, the Application can only get byte arrays or
strings (binary and text representation, rsp.) and has to parse it on
its own. When registering this extension, the Application can simply
call getObject(column) on the result of the query, and get a real java
object that is modeled after the OpenGIS spec. It also can create or
modify this objects itsself and then pass them into the database via the
PreparedStatement.setObject() method.

The code I posted is a rework of the JDBC driver extension originally
written by Paul Ramsey. Apart from some code rework, I made it
compatible to PostGIS 1.0 which mainly consisted of creating a EWKB-Hex
parser.


I hope this answers your question. If not, feel free to ask again :-)

Markus



More information about the postgis-devel mailing list