Hibernate配置c3p0的hibernate.cfg.xml文件

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
          "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
          "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<!-- Generated by MyEclipse Hibernate Tools.                   -->
<hibernate-configuration>

 <session-factory>
  <property name="show_sql">true</property>
  <property name="dialect">
   org.hibernate.dialect.MySQLDialect
  </property>
  <property name="connection.url">jdbc:mysql://localhost:3306/test</property>
  <property name="connection.username">root</property>
  <property name="connection.password">123456</property>
  <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
  <property name="myeclipse.connection.profile">test</property>
  <!-- c3p0的配置 -->
  <property name="connection.provider_class">
    org.hibernate.connection.C3P0ConnectionProvider
  </property>
  <property name="c3p0.min_size">5</property>
  <property name="c3p0.max_size">20</property>
  <property name="c3p0.timeout">1800</property>
  <property name="c3p0.idle_test_period">120</property>
  <property name="c3p0.acquire_increment">30</property>
  <property name="c3p0.max_statements">50</property>
  <mapping resource="com/entity/Operation.hbm.xml" />
 </session-factory>

</hibernate-configuration>

你可能感兴趣的:(Hibernate,xml,mysql,jdbc,MyEclipse)