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


    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>






  • 相关阅读:
    android连接wifi模块
    idea 控制台乱码debug
    线程控制
    jvm 垃圾回收
    java 单例模式
    http报头
    java 构造函数 , 参数传递 , lamda表达式
    mysql 杂识
    spring mvc 配置 拦截器不起作用
    spring mvc 每次请求后是否自动销毁线程
  • 原文地址:https://www.cnblogs.com/ssslinppp/p/4546090.html
Copyright © 2020-2023  润新知