[postgis-users] PostGIS and Java

Gérald Quintana gerald.quintana at gmail.com
Mon Mar 3 23:50:17 PST 2008


Hello,

I am using PostGIS 1.3.2 with PostgreSQL 8.2 and Java 6 and Debian
Linux Testing.

The Java/JDBC examples provided in chapter 4.8 of documentation don't work.
http://postgis.refractions.net/docs/ch04.html#id2911266

I can't find the org.postgresql.Connection class, does it still exist?
If I use the org.postgresql.PGConnection instead, addDataType methods
are deprecated and do nothing (the resultSet.getObject("geom") returns
a String instead of PGgeometry).

At the moment, the only workaround I found is using the basic JDBC
connection without modification and then I do
PGgeometry pgGeometry = new PGgeometry( (String) resultSet.getObject("geom") );

Is it the right way to read the geo data?

Thanks for your help,
Gerald



More information about the postgis-users mailing list