I'm using JasperReports and would like to hand a connection off that I obtain from Hibernate's DBCP connection pool.
Using...
Code:
Connection connection = sessionFactory.openSession().connection();
...I find that what I get is not a
java.sql.Connection that Jasper can deal with but rather a
org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapperSearching around I found that there is a way to get at the underlying connection by setting a preference...
Code:
PoolingDriver.setAccessToUnderlyingConnectionAllowed(true);
The problem is that Hibernate is handling the DBCP connection pool, so I need to somehow set this flag via Hibernate's properties file. Something like...
Code:
hibernate.dbcp.setAccessToUnderlyingConnectionAllowed true
...only this didn't work. Any ideas?