• java中hibernate的相关配置


    <?xml version="1.0" encoding="UTF-8"?>
    <!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>
    <!--指定链接数据库所用的驱动-->
    <property name="hibernate.connection.driver_class">com.mysql.cj.jdbc.Driver</property>
    <!--指定链接数据库的url,其中sundays是本应用链接的数据库名-->
    <property name="hibernate.connection.url">jdbc:mysql://localhost/sundays?useUnicode=true&amp;characterEncoding=utf-8&amp;useSSL=false&amp;serverTimezone=GMT</property>
    <!--指定链接数据库的用户名-->
    <property name="hibernate.connection.username">root</property>
    <!--指定链接数据库的密码-->
    <property name="hibernate.connection.password">123456</property>
    <!--指定连接池里最大链接数-->
    <property name="hibernate.c3p0.max_size">10</property>
    <!--指定链接池最小链接数-->
    <property name="hibernate.c3p0.min_size">1</property>
    <property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
    <property name="hibernate.show_sql">true</property>
    <property name="hibernate.format_sql">true</property>
    <property name="hibernate.hbm2ddl.auto">update</property>
    <!--指定连接池里链接的超时时长-->
    <property name="hibernate.c3p0.timeout"></property>
    <!--指定连接池里最大缓存多少个Statement对象-->
    <property name="hibernate.c3p0.max_statements">100</property>
    <property name="hibernate.c3p0.idle_test_period">300</property>
    <property name="hibernate.c3p0.acquire_increment">2</property>
    <property name="hibernate.c3p0.validate">ture</property>
    <!--持久化类名-->
    <mapping resource="com/sunday/hibernate/helloworld/News.hbm.xml"/>
    </session-factory>
    </hibernate-configuration>

     

  • 相关阅读:
    bzoj2143 飞飞侠
    Codeforces 543.B Destroying Roads
    Codeforces 666.B World Tour
    bzoj2441 [中山市选2011]小W的问题(debug中)
    bzoj2329 [HNOI2011]括号修复
    一些新发现的好东西
    < meta http-equiv = "X-UA-Compatible" content = "IE=edge,chrome=1" />的作用
    js经典代码技巧学习之一:使用三元运算符处理javascript兼容
    《javascript高级程序设计》笔记4.1.4:检测类型
    页面关闭和刷新事件
  • 原文地址:https://www.cnblogs.com/sundaysjava/p/10325731.html
Copyright © 2020-2023  润新知