<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
 "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
 <hibernate-configuration>
     <session-factory>
         <!-- 数据库驱动 -->
        <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
        <!-- 数据库连接的URL -->
        <property name="connection.url">jdbc:mysql://localhost:3306/db_database10?characterEncoding=utf8</property>
        <!-- 数据库连接用户名 -->
        <property name="connection.username">root</property>
        <!-- 数据库连接密码 -->
        <property name="connection.password">111</property>
        <!-- Hibernate方言 -->
        <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
        <!-- 打印SQL语句 -->
        <property name="show_sql">true</property>
        <!-- 映射文件  -->
        <mapping resource="com/mr/employee/Employee.hbm.xml"/>
        <mapping resource="com/mr/product/Product.hbm.xml"/>
     </session-factory>
 </hibernate-configuration>

 jdbc:mysql://localhost:3306/db_database10?characterEncoding=utf8

posted on 2016-04-24 21:02  qqhfeng16  阅读(376)  评论(0编辑  收藏  举报