休眠> 3.3 和c3p0
由于 c3p0 似乎不再与 Hibernate 捆绑在一起(从版本 > 3.3 开始,我使用 Hibernate 3.6.0),我想知道如何将 c3p0 与 Hibernate 集成。
显然,旧的方法
<property name="connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
似乎不再适用,因为 Hibernate 不再提供 C3P0ConnectionProvider 类。我现在必须自己构建它还是集成 hibernate-c3p0-3.3.x.jar 是否安全?
注意:我使用的是裸 Hibernate,没有 Spring 等。
As c3p0 does not seem to be bundled with Hibernate anymore (as of versions > 3.3, I am using Hibernate 3.6.0), I'd like to know how to integrate c3p0 with Hibernate.
Obviously the old approach with
<property name="connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
does not seem to work anymore, as the class C3P0ConnectionProvider is not provided by Hibernate anymore. Do I now have to build this on my own or is it safe to integrate the hibernate-c3p0-3.3.x.jar?
Note: I am using bare Hibernate, no Spring etc.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在
hibernate.cfg.xml
中使用以下内容:我使用最新的 hibernate(当前为 3.6.0 GA),并且我已将其包含在类路径中
c3p0-0.9.1.2.jar(当前最新)。一切都按预期进行。
I use the following in
hibernate.cfg.xml
:I use the latest hibernate (currently 3.6.0 GA) and I've included in the classpath
c3p0-0.9.1.2.jar
(currently latest). Everything works as expected.也许你需要 hibernate-c3po-3..jar
perhaps you need hibernate-c3po-3..jar