<?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="connection.driver_class">
oracle.jdbc.OracleDriver
</property>
<property name="connection.url">
jdbc:oracle:thin:@localhost:1521:orcl
</property>
<property name="connection.username">scott</property>
<property name="connection.password">tiger</property>
<!-- 辅助参数 -->
<property name="dialect">
org.hibernate.dialect.Oracle10gDialect
</property>
<property name="show_sql">true</property>
<property name="format_sql">true</property>
<property name="current_session_context_class">thread</property>
<!-- 映射信息 ,指明该类的xml文件位置,包名+xml文件名-->
<mapping resource="po/User.hbm.xml"/>
<mapping resource="po/District.hbm.xml"/>
<!-- <mapping resource="po/House.hbm.xml"/> -->
<!-- <mapping resource="po/Street.hbm.xml"/> -->
</session-factory>
</hibernate-configuration>
版权声明:本文为博主原创文章,未经博主允许不得转载。