我如何设置自己的连接到休眠?

时间:2012-07-15 11:08:54

标签: java hibernate jdbc

我有自己的数据库处理程序和我的连接池,我只想设置“我自己创建之前”与hibernate的连接。

如果我必须使用ConnectionProvider,我有一些问题, 我还必须在hibernate.cfg.xml中配置“hibernate.connection.driver_class”或“hibernate.connection.username”等属性吗?

1 个答案:

答案 0 :(得分:0)

第3版

Connection conn = ...;
Session session = sessionFactory.openSession(conn);