RES: [postgis-users] JDBC2 Question

Gustavo Henrique Sberze Ribas gribas at cpqd.com.br
Fri Apr 15 10:27:43 PDT 2005


Hello,

 try this:

     ((org.postgresql.PGConnection)connection).addDataType("geometry","org.postgis.PGgeometry");
     ((org.postgresql.PGConnection)connection).addDataType("box3d","org.postgis.PGbox3d");        
                      ^^^^^^^^^^^^


--
Gustavo


-----Mensagem original-----
De: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net]Em nome de Eli Dylan Lorimer
Enviada em: sexta-feira, 15 de abril de 2005 14:04
Para: postgis-users at postgis.refractions.net
Assunto: [postgis-users] JDBC2 Question


Hi, 
I've successfully installed PostgreSQL and I belive PostGIS. The postgis jar file is in my classpath, as is the postgresql. I am capable of querying a standard table via jdbc. What I cannot seem to do though is use the PostGIS JDBC extension objects so that I can directly access the spatial geometry. Specifically, the bit in the supplied code here: 


((org.postgresql.Connection)conn).addDataType("geometry","org.postgis.PGgeometry"); 
((org.postgresql.Connection)conn).addDataType("box3d","org.postgis.PGbox3d"); 


isn't resolving. I'm getting this error: 
org.postgresql.Connection cannot be resolved or isn't a type. 


My imports are as follows: 
import org.postgis.*; 
import org.postgresql.*; 


Any ideas?



More information about the postgis-users mailing list