/hibernate_03(xml)/src/hibernate.cfg.xml
<?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.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql:///hibernate</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">1234</property>
<property name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.format_sql">true</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<!-- 配置和当前线程绑定的session进行开启配置 -->
<property name="hibernate.current_session_context_class">thread</property>
<!-- 引入映射文件 -->
<mapping resource="cn/itcast/domain/Customer.hbm.xml"/>
<mapping resource="cn/itcast/domain/Linkman.hbm.xml"/>
<mapping resource="cn/itcast/domain/User.hbm.xml"/>
<mapping resource="cn/itcast/domain/Role.hbm.xml"/>
</session-factory>
</hibernate-configuration>
<?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.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql:///hibernate</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">1234</property>
<property name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.format_sql">true</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<!-- 配置和当前线程绑定的session进行开启配置 -->
<property name="hibernate.current_session_context_class">thread</property>
<!-- 引入映射文件 -->
<mapping resource="cn/itcast/domain/Customer.hbm.xml"/>
<mapping resource="cn/itcast/domain/Linkman.hbm.xml"/>
<mapping resource="cn/itcast/domain/User.hbm.xml"/>
<mapping resource="cn/itcast/domain/Role.hbm.xml"/>
</session-factory>
</hibernate-configuration>