I'm using Hibernate 3.2.5 in a project and Jasper 3.7.2 to generate Some Reports for the application.
Is there any way to get a Connection Object from a HibernateSessionFactory Object? I wanna handle only one connection, because at this time I have to have a properties file for the ODBC connection that is gonna handle the Jasper through the JasperRunManager statics methods, and also Hibernate for other side.
This is the method I need to pass the connection:
byte[] net.sf.jasperreports.engine.JasperRunManager.runReportToPdf(InputStream inputStream, Map parameters, Connection conn) throws JRException
Thanks in advance. :)
This works awesomely and you can use the connection object elsewhere where you may need it in the code. doWork may need you to keep doing that many times but creating a connection object nice is a cleaner solution.
Where
session
is the name of the Hibernate Session objectI had the same problem with hibernate 4 and here is solution