[postgis] PostGIS JDBC

bouabdaddy bouabdi9 at cs.man.ac.uk
Sun Mar 3 04:58:23 PST 2002


Hi everyone,

can anybody help me out with the following runtime error:

Exception occurred during event dispatching:
java.lang.ClassCastException: java.lang.String
        at canned_classes.JDBCAdapter.executeGISQuery
(JDBCAdapter.java:89)
        at canned_classes.QueryToolInterface.fetchSiteBoundaries
(QueryToolInterface.java:200)
        at canned_classes.QueryToolInterface$3.actionPerformed
(QueryToolInterface.java:130)



This is the code at line 89 JDBCAdapter.java

PGgeometry polygon = (PGgeometry)resultSet.getObject(2);
System.out.println("Got site_boundary:");
System.out.println(polygon.toString());

This is the code at line 200 QueryToolInterface.java:

//this line calles the method executeGISQuery in JDBCAdapter.java 
which trips up at the codes above

dataBase.executeGISQuery("select boundary_id, AsText
(external_boundary) as external_boundary, Astext(site_centroid) as 
site_centroid from geom_site_boundary;");




I have included the following additions to the data types of the 
Postgresql connection:

	    ((org.postgresql.Connection)connection).addDataType
("geometry","org.postgis.PGgeometry");
	    ((org.postgresql.Connection)connection).addDataType
("multipolygon","org.postgis.MultiPolygon");
    	((org.postgresql.Connection)connection).addDataType
("box3d","org.postgis.PGbox3d");
	    ((org.postgresql.Connection)connection).addDataType
("polygon","org.postgis.Polygon");
       	((org.postgresql.Connection)connection).addDataType
("point","org.postgis.Point");

and of course: import org.postgis.*;

Best regards

Ismail


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Tiny Wireless Camera under $80!
Order Now! FREE VCR Commander!
Click Here - Only 1 Day Left!
http://us.click.yahoo.com/nuyOHD/7.PDAA/yigFAA/PhFolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
postgis-unsubscribe at yahoogroups.com

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 





More information about the postgis-users mailing list