Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#609 closed defect (fixed)

Bad source code in manual section 5.2 Java Clients

Reported by: simoc Owned by: pramsey
Priority: low Milestone: PostGIS 1.5.3
Component: postgis Version: 1.5.X
Keywords: history JDBC client documentation Cc:


I found some errors in the example Java source code in section 5.2 'Java Clients (JDBC)' of postgis-1.5.1.pdf:






ResultSet r = s.executeQuery("select ST_AsText(geom) as geom,id from geomtable"); 


ResultSet r = s.executeQuery("select geom,id from geomtable");


if( geom.getType() = Geometry.POLYGON ) { 


if( geom.getGeoType() == Geometry.POLYGON ) {

Change History (4)

comment:1 by simoc, 12 years ago

Documentation source file to be updated is doc/using_postgis_app.xml

comment:2 by robe, 11 years ago

Resolution: fixed
Status: newclosed

Okay I feel the recommendation for first part is wrong. Last bit of java programming I tortured myself with — I think I used this syntax — and a JDBC4 driver.

So I have instead opted to replace the first part with


the rest of the suggestions look fine, but I haven't tested the code and am not really setup to at the moment.

so fixed at r7362 for PostGIS 1.5 and r7363 for PostGIS 2.0

comment:3 by simoc, 11 years ago

Yes, using PGConnection.addDataType(String, String) also works for me, although that method is deprecated. The recommended replacement method in the PGConnection Javadoc is:


That method also works correctly for me.

comment:4 by robe, 11 years ago

Keywords: history added

Done r7383 for PostGIS 1.5, r7384 PostGIS 2.0

Simoc, What is your real name?

Thanks, Regina

Note: See TracTickets for help on using tickets.