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>
  • 相关阅读:
    Add Two Numbers
    Same Tree
    Single Number
    题目1190:大整数排序
    题目1182:统计单词
    题目1181:遍历链表
    题目1180:对称矩阵
    题目1179:阶乘
    题目1206:字符串连接
    HTML事件
  • 原文地址:https://www.cnblogs.com/hyjj/p/6248831.html
Copyright © 2011-2022 走看看