How to create hibernate entity manager using java.sql.Connection
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.
精彩评论