zoukankan      html  css  js  c++  java
  • Hibernate连接mysql数据库的配置

    <?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="dialect">org.hibernate.dialect.MySQLDialect</property>
            <property name="connection.url">
                jdbc:mysql://localhost:3306/test
            </property>
            <!--连接MySQL的用户名 -->
            <property name="connection.username">root</property>
            <!--连接MySQL的密码 -->
            <property name="connection.password">root</property>
            <!--连接MySQL的驱动类名 -->
            <property name="connection.driver_class">
                com.mysql.jdbc.Driver
            </property>
            <property name="current_session_context_class">thread</property>
            <!--以格式良好的方式显示SQL语句 -->
            <property name="format_sql">true</property>
            <!--显示SQL语句 -->
            <property name="show_sql">true</property>
            <!-- 表结构更新机制 -->
            <property name="hbm2ddl.auto">update</property>
            <mapping resource="cn/entity/student.hbm.xml"/>
        </session-factory>
    </hibernate-configuration>
  • 相关阅读:
    Go语言指针
    程序员 需要掌握得600个英语单词
    Go语言管道
    Go语言容器
    Go语言切片
    Go语言类型转换
    Go语言数组
    LR静态存储/动态存储/指针变量脚本说明
    MQ报错2009/2085解决方法
    Windows性能监控监视器(perfmon使用)
  • 原文地址:https://www.cnblogs.com/hyjj/p/6248831.html
Copyright © 2011-2022 走看看