hibernate配置文件--hibernate.cfg.xml

来源:互联网 发布:2017最新潮网络词 编辑:程序博客网 时间:2024/04/28 13:16

<?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>

        <!-- Database connection settings -->
        <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
        <property name="connection.url">jdbc:mysql://localhost:3306/struts</property>
        <property name="connection.username">root</property>
        <property name="connection.password">liangli</property>

        <!-- JDBC connection pool (use the built-in) -->
        <property name="connection.pool_size">1</property>

        <!-- SQL dialect -->
        <property name="dialect">org.hibernate.dialect.MySQLDialect</property>

        <!-- Echo all executed SQL to stdout -->
        <property name="show_sql">true</property>

        <mapping resource="com/rz/domain/Student.hbm.xml"/>
        <mapping resource="com/rz/domain/Books.hbm.xml"/>
  <mapping resource="com/rz/domain/User.hbm.xml"/>
  <!-- <mapping class="com.rz.domain.Student"/> -->
    </session-factory>

</hibernate-configuration>