您的位置:首页 > 其它

hibernate配置详情1(hibernate.cfg.xml)

2017-02-17 22:56 387 查看
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
<session-factory name="foo">
<!--数据库连接配置4项  -->
<!-- 数据库连接字符串 -->
<property name="connection.url">jdbc:oracle:thin:@127.0.0.1:1521:orcl</property>
<!-- 数据库用户名 -->
<property name="connection.username">scott</property>
<!-- 数据库密码-->
<property name="connection.password">tiger</property>
<!-- 数据库连接驱动-->
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<!--数据库方言(数据类型的配置)  -->
<property name="dialect">org.hibernate.dialect.Oracle10gDialect</property>
<!--数据库相关配置  -->
<property name="show_sql">true</property>
<!--格式化  -->
<property name="format_sql">true</property>
<!--映射,有几张表就配置几个映射  -->
<mapping resource="org/hibernate_one/entity/Dept.hbm.xml"/>

</session-factory>
</hibernate-configuration>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: