how to obtain JDBC connection from JPA entity manager?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

how to obtain JDBC connection from JPA entity manager?

sarah.kho
Hi,

Can you please let me know how I can obtain JDBC connection or a JDBC Statement when I am using JPA/  EclipseLink?

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: how to obtain JDBC connection from JPA entity manager?

Mitesh Meswani-2
Why do you need to get to native connection? To execute a custom SQL,
did you try using EnetityManager.createNativeQuery("custom sql")?

-Mitesh
EclipseLink On 6/7/2010 12:44 AM, Sarah kho wrote:
> Hi,
>
> Can you please let me know how I can obtain JDBC connection or a JDBC
> Statement when I am using JPA/  EclipseLink?
>
> Thanks.