[postgis-users] postgis with jdbc

Gilbert, Antoine AGilbert at korem.com
Fri Jan 6 05:58:37 PST 2006



I just installed PostgreSQL 8.1, supposed to be packaged with postgis


So far I have 2 questions


The jdbc example provided by the documentation dosen't work for me.
Given these 2 statements :



This object doesn't exists : org.postgresql.Connection, I tried with
org.postgresql.PGConnection, but I keep getting class cast exceptions
when doing rs.getObject().. (if I do getString(2) all ok)


Here is my complete test code :




        Statement stmt = connection.createStatement();

        ResultSet rs = stmt.executeQuery("select \"STREET\",
AsText(\"geom\") as geom from rue_test");

        ResultSetMetaData rsmd = rs.getMetaData();

        for(int i=0;i<rsmd.getColumnCount();i++)



            String street = rs.getString(1);


            PGgeometry geometry = (PGgeometry)rs.getObject(2);



Second question. I loaded some line objects on my postgressql database
with FME, and the objects are flagged as MULTIPOINT, I would have
expected these objects to be of type LINE or MULTILINE instead.
Neverlesss, when I use some viewers to see these objects they show as
lines (FME viewer). Where I can find real explanations about all
geometry types used by postgis. (sorry but the postgis doc doesn't help)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20060106/a0b8edf4/attachment.html>

More information about the postgis-users mailing list