无法在hibernate中将我的项目与c3p0集成?

时间:2014-08-28 10:06:47

标签: java hibernate c3p0 toad

我已经看到了类似的其他问题,但我无法解决我的问题。我正在尝试将c3p0池集成到我的项目中。这是我的cfg文件:

<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/xyz</property>
<property name="hibernate.connection.username">Prashant</property>
<property name="hibernate.connection.password">xyz@123</property>

<property name="hibernate.current_session_context_class">thread</property>
<property name="hibernate.show_sql">true</property>


<property name="hibernate.c3p0.min_size">5</property>
<property name="hibernate.c3p0.max_size">20</property>
<property name="hibernate.c3p0.timeout">30</property>
<property name="hibernate.c3p0.max_statements">50</property>
<property name="hibernate.c3p0.idle_test_period">5</property> 

 <mapping class="classes.db_connection"></mapping>

<mapping resource="Save.hbm.xml"/>
<mapping resource="adb.hbm.xml"/>
<mapping resource="msgs.hbm.xml"/>

</session-factory>
</hibernate-configuration>

我还添加了c3p0.jar.But当我运行我的项目并检查没有使用Toad for MYSQL的活动连接时,我发现连接在特定时间间隔后没有超时。

0 个答案:

没有答案