Re: Tomcat JDBC Connection Pool interfaces to PostgreSQL... - Mailing list pgsql-jdbc

From David G. Johnston
Subject Re: Tomcat JDBC Connection Pool interfaces to PostgreSQL...
Date
Msg-id CAKFQuwY5A3Fms5-77wmH242QtWL1wQvF=7zR6fVxhALeYVX1XQ@mail.gmail.com
Whole thread Raw
In response to Tomcat JDBC Connection Pool interfaces to PostgreSQL...  (Eric Neron <eneron@e-djuster.ca>)
List pgsql-jdbc
On Tue, May 17, 2016 at 2:40 PM, Eric Neron <eneron@e-djuster.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.

pgsql-jdbc by date:

Previous
From: Dave Cramer
Date:
Subject: Re: Tomcat JDBC Connection Pool interfaces to PostgreSQL...
Next
From: Eric Neron
Date:
Subject: Re: Tomcat JDBC Connection Pool interfaces to PostgreSQL...