zoukankan      html  css  js  c++  java
  • 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>

     

  • 相关阅读:
    精细化python 类的内置属性
    python操作excel
    ghost linux
    Linux dd 命令
    Ubantu 使用root登陆的方法
    NSIS Error: "Error writing temporary file. Make sure your temp folder is valid
    error writing temporary file。make sure your temp folder is valid 问题已解决
    安卓电池状态监听
    Android源码下载
    vim插件详细安装过程
  • 原文地址:https://www.cnblogs.com/sundaysjava/p/10325731.html
Copyright © 2011-2022 走看看