[Postgis][javax.sql.DataSource] Failed - Mailing list pgsql-jdbc

From Micka
Subject [Postgis][javax.sql.DataSource] Failed
Date
Msg-id AANLkTimGkxuOVOLnLqGdwmhibPaaAP-JriWJq=oSR8Vq@mail.gmail.com
Whole thread Raw
Responses Re: [Postgis][javax.sql.DataSource] Failed
List pgsql-jdbc
Hi,

I'm developping an application on Tomcat7.

I'm using the DataSource for pooling my connection :

<Context reloadable="false">
  <Resource name="jdbc/TestPool"
    auth="Container"
    type="javax.sql.DataSource"
    maxActive="100"
    maxIdle="30"
    maxWait="20000"
    logAbandoned="true"
    removeAbandoned="true"
    removeAbandonedTimeout="10"
    testOnBorrow="true"
    validationQuery="SELECT 1"
    validationInterval="30000"
    username="Test"
    password="**********"
    driverClassName="org.postgresql.Driver"
    url="jdbc:postgresql://172.17.100.14/D_TEST?autoReconnect=true"
  />
</Context>


It seems that the connection that I got can't be casted to PGconnection :

java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper cannot be cast to org.postgresql.PGConnection
    at Test.DataBaseConnector.connection(DataBaseConnector.java:134)
    at Test.DataBaseConnector.<init>(DataBaseConnector.java:94)
    at Test.Guardian_Process.<init>(Guardian_Process.java:36)
    at Test.ServletListener.contextInitialized(ServletListener.java:36)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4600)
    at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5097)
    at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5092)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)


So my question is:

How can I manipulate geometry data In my case ?

pgsql-jdbc by date:

Previous
From: Dave Cramer
Date:
Subject: Re: Problem with executeBatch and "A result was returned when none was expected"
Next
From: Dave Cramer
Date:
Subject: Re: [Postgis][javax.sql.DataSource] Failed