Configuration of Hibernate.cfg.xml and C3P0 connection pools

Source: Internet
Author: User

<?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" >

<session-factory>
<!--configuration Database connection Properties--
<property name= "Myeclipse.connection.profile" >MySQL5.0</property>
<property name= "Connection.url" >
jdbc:mysql://localhost:3306/crm?useunicode=true&amp;characterencoding=gb2312
</property>
<property name= "Connection.username" >root</property>
<property name= "Connection.password" >root</property>
<property name= "Connection.driver_class" >
Com.mysql.jdbc.Driver
</property>
<property name= "dialect" >
Org.hibernate.dialect.MySQLDialect
</property>
<property name= "Show_sql" >true</property>
<!--configuring C3P0 Connection Pool Properties-
<property name= "Hibernate.connection.provider_class" >
Org.hibernate.connection.C3P0ConnectionProvider
</property>
<property name= "Hibernate.c3p0.max_size" >20</property>
<property name= "Hibernate.c3p0.min_size" >5</property>
<property name= "Hibernate.c3p0.timeout" >50000</property>
<property name= "Hibernate.c3p0.max_statements" >100</property>
<property name= "Hibernate.c3p0.idle_test_period" >3000</property>
<!--when the connection pool runs out and receives a request to get a connection, the number of new connections is increased-
<property name= "Hibernate.c3p0.acquire_increment" >2</property>
<!--verify, check Connect-
<property name= "Hibernate.c3p0.validate" >false</property>

<!--configuring persistent mapping files--
<mapping resource= "Com/orm/city.hbm.xml"/>
<mapping resource= "Com/orm/client.hbm.xml"/>
<mapping resource= "Com/orm/province.hbm.xml"/>
</session-factory>

Configuration of Hibernate.cfg.xml and C3P0 connection pools

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.