[postgis-users] Updating geometries with JDBC

Chris Holmes cholmes at openplans.org
Tue Oct 28 07:50:15 PST 2003


Hi, I was wondering if anyone had experience using JDBC's ResultSet's 
update methods with postgis geometries.  I'm using jts geometries in my 
client code, and would like to use updateString or updateObject to update 
a current result set to the new geometry.

I've tried updateString(3, GeometryFromText( wkt-string, -1))
and updateString(3, SRID=-1;wkt-string).  Both resulted in sql error: 
Relation 'road' does not have attribute 'astext'.  I also tried 
updateObject with similar results.

I then tried using the name of the column: 'the_geom', and then I got 
errors that said: The column name the_geom not found.

Has anyone encountered errors like this before, and might know a 
workaround?  In the past I've just constructed sql statements directly and 
executed them, using GeometryFromText, and that always worked fine.  But 
we're chaning our api around, and it makes things _much_ cleaner if I can 
use the update result set statements.  If there's an easy way to turn the 
objects directly into the postgis objects I'd be open to that as well, but 
I'd need some pointers how to go about doing so.


	thanks,


	     Chris 




More information about the postgis-users mailing list