Vertica connection pool

Hi, Anyone has experience with a java connection pool (outside from a J2EE container) that provides raw Vertica connections? I tried to use the VerticaCopyStream object which receives as input a VerticaConnection. But the connection pools: c3p0, DBCP and BoneCP create a proxy over the database connection causing an class cast exception during the casting to a VerticaConnection. VerticaCopyStream stream = new VerticaCopyStream((VerticaConnection)ds.getConnection() , copy.build()) If a use the DriverManagerDataSource from Spring, I can create the VerticaConnection but according Spring docs: "This class is not an actual connection pool; it does not actually pool Connections." Any help will be appreciated.


  • Options
    Hi Oliver Some connection pooling libraries provide an API to get at the inner connection that the proxy wraps. For example, in DBCP, you should be able to do something like the following (see the accessToUnderlyingConnectionAllowed parameter here for details http://commons.apache.org/proper/commons-dbcp/configuration.html): Connection conn = ds.getConnection(); Connection dconn = ((DelegatingConnection) conn).getInnermostDelegate(); ... conn.close() dconn in this case should be the VerticaConnection. In JDBC 4.0 there is a Wrapper API that standardizes this process, but unfortunately our driver does not yet implement that version of the standard.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file