码迷,mamicode.com
首页 > Web开发 > 详细

hibernate.cfg.xml基本配置

时间:2015-05-08 23:34:03      阅读:198      评论:0      收藏:0      [点我收藏+]

标签:

  

<?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.url">
jdbc:oracle:thin:@localhost:1521:xe
</property>
<property name="connection.username">lhh</property>
<property name="connection.password">123456</property>
<property name="connection.driver_class">
oracle.jdbc.OracleDriver
</property>
<!-- Hibernate配置信息 -->
<!-- dialect方言,用于配置生成针对哪个数据库的SQL语句 -->
<property name="dialect">
<!--方言类,Hibernate提供的,用于封装某种特定数据库的方言 -->
org.hibernate.dialect.OracleDialect
</property>
<property name="show_sql">true</property>
<property name="format_sql">true</property>
<!-- 在配置文件中关联映射文件 -->
<mapping resource="com/tarena/pojo/Person.hbm.xml" />
</session-factory>
</hibernate-configuration>

hibernate.cfg.xml基本配置

标签:

原文地址:http://www.cnblogs.com/Crow00/p/4489021.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!