[postgis] ClassCast Exception

bouabdaddy bouabdi9 at cs.man.ac.uk
Mon Mar 4 05:54:20 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 ---------------------~-->
Access Your PC from Anywhere
Check Email & Transfer files - Free Download
http://us.click.yahoo.com/Z8IZpD/3XkDAA/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