码迷,mamicode.com
首页 > Web开发 > 详细

【Hibernate学习笔记-4】在hibernate.cfg.xml中配置C3P0数据源

时间:2015-06-02 13:19:20      阅读:106      评论:0      收藏:0      [点我收藏+]

标签:

jar包

技术分享


hibernate.cfg.xml

技术分享
  1. <?xml version="1.0" encoding="GBK"?>
  2. <!DOCTYPE hibernate-configuration PUBLIC
  3. "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
  4. "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
  5. <hibernate-configuration>
  6. <session-factory>
  7. <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
  8. <property name="connection.url">jdbc:mysql://localhost:3306/sampledb</property>
  9. <property name="connection.username">root</property>
  10. <property name="connection.password">qaz</property>
  11. <property name="hibernate.c3p0.max_size">20</property>
  12. <property name="hibernate.c3p0.min_size">1</property>
  13. <property name="hibernate.c3p0.timeout">5000</property>
  14. <property name="hibernate.c3p0.max_statements">100</property>
  15. <property name="hibernate.c3p0.idle_test_period">3000</property>
  16. <property name="hibernate.c3p0.acquire_increment">2</property>
  17. <property name="hibernate.c3p0.validate">true</property>
  18. <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
  19. <property name="hbm2ddl.auto">update</property><!--①-->
  20. <property name="show_sql">true</property>
  21. <property name="hibernate.format_sql">true</property>
  22. <mapping class="org.crazyit.app.domain.News"/>
  23. </session-factory>
  24. </hibernate-configuration>






【Hibernate学习笔记-4】在hibernate.cfg.xml中配置C3P0数据源

标签:

原文地址:http://www.cnblogs.com/ssslinppp/p/4546090.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!