开发者

How to create hibernate entity manager using java.sql.Connection

开发者 https://www.devze.com 2023-03-25 23:55 出处:网络
I开发者_Go百科 want to create Hibernate entity manager using java.sql.Connection object, with out persistence unit, Is there any way to achieve this?

I开发者_Go百科 want to create Hibernate entity manager using java.sql.Connection object, with out persistence unit, Is there any way to achieve this?

The scenario is my application uses Hibernate, in a flow we will call a independent Java program which returns a connection object, i have to use the same connection to persist the transaction.


You can define your own plugin strategy for obtaining JDBC connections by implementing the interface org.hibernate.connection.ConnectionProvider, and specifying your custom implementation via the hibernate.connection.provider_class property.

0

精彩评论

暂无评论...
验证码 换一张
取 消