I have developped a JAR that extract Oracle record's list and generate a Excel file. This program can be started alone, directly from shell. The connection parameters (database, userid, password) are passed in a configuration file.
Now, I have integrated this program in a J2EE application that use JPA and QueryDsl to work with Oracle database.
The program work well but it need to open a new JDBC connection every time I will generate a new Excel file.
J2EE application has a lot of connections already open and I'm interesting to use one of them.
How can I obtain a JDBC connection from JPA and pass it to my JAR ?
If this is not possible from JPA, can I do that using EclipseLink JPA provider ?