c3p0配置

Posted 15林志杰

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了c3p0配置相关的知识,希望对你有一定的参考价值。

<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">

<hibernate-configuration>

<session-factory>

<!--配置mysql数据库连接参数-->
<property name="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql:///test</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">root</property>
<!-- 配置C3P0连接池参数 -->
<property name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
<property name="hibernate.c3p0.max_size">10</property>
<property name="hibernate.c3p0.min_size">5</property>
<property name="hibernate.c3p0.timeout">5000</property>
<property name="hibernate.c3p0.max_statements">10</property>

<property name="hibernate.show_sql">true</property>
<property name="hibernate.format_sql">true</property>

<mapping resource="com/jikexueyuan/entity/Student.hbm.xml"/>
</session-factory>



</hibernate-configuration>

以上是关于c3p0配置的主要内容,如果未能解决你的问题,请参考以下文章

c3p0配置详解

C3P0的配置方式

spring配置c3p0连接池

C3P0详细配置

Mysql配置C3P0

C3P0配置属性的说明