Re: Tomcat JDBC Connection Pool interfaces to PostgreSQL...

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Eric Neron <eneron(at)e-djuster(dot)ca>
Cc: List <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Tomcat JDBC Connection Pool interfaces to PostgreSQL...
Date: 2016-05-17 21:47:45
Message-ID: CAKFQuwY5A3Fms5-77wmH242QtWL1wQvF=7zR6fVxhALeYVX1XQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Tue, May 17, 2016 at 2:40 PM, Eric Neron <eneron(at)e-djuster(dot)ca> wrote:

>
> The Tomcat documentation suggests to extract the native connection by
> using the following method:
>
> Connection pgConnection = ((javax.sql.PooledConnection) conn).
> getConnection ( );
>
> Although this does not fail, using a debugger, I can see that pgConnection
> is really an
> org.postgresql.jdbc.PgConnection (not an org.postgresql.PGConnection),
> and there is not way it seems that I can bridge between the two... even by
> using:
>
>
​​​If you get this I'm not sure where the issue is...

org.postgresql.jdbc.PgConnection implements org.postgresql.core.BaseConnect
which extends​

​org.postgresql.PGConnection​ which is the interface that you desire.

> pgConnection.unwrap ( PGConnection.class );
>
> ​
Not sure...

David J.

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Eric Neron 2016-05-17 22:16:26 Re: Tomcat JDBC Connection Pool interfaces to PostgreSQL...
Previous Message Dave Cramer 2016-05-17 21:39:57 Re: Tomcat JDBC Connection Pool interfaces to PostgreSQL...