Hibernate核心配置文件

本文详细介绍了Hibernate配置文件hibernate.cfg.xml的内容,包括数据库连接参数、显示SQL设置、映射文件等关键配置项。

src目录下 hibernate.cfg.xml:

 1 <?xml version="1.0" encoding="UTF-8"?>
 2 
 3 <!DOCTYPE hibernate-configuration PUBLIC
 4 
 5     "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
 6 
 7     "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
 8 
 9     <hibernate-configuration>
10 
11     <session-factory>
12 
13     <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
14 
15     <property name="hibernate.connection.url">jdbc:mysql:///hibernate_day03?useUnicode=true&amp;characterEncoding=UTF8</property>
16 
17     <property name="hibernate.connection.username">root</property>
18 
19     <property name="hibernate.connection.password"></property>
20 
21     <property name="hibernate.show_sql">true</property>
22 
23     <property name="hibernate.format_sql">true</property>
24 
25     <property name="hibernate.hbm2ddl.auto">update</property>
26 
27     <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
28 
29     <mapping resource="cn/cuibin/entity/Customer.hbm.xml"/>
30 
31     <mapping resource="cn/cuibin/entity/LinkMan.hbm.xml"/>
32 
33     </session-factory>
34 
35     </hibernate-configuration>

 

转载于:https://www.cnblogs.com/cuibin/p/6708276.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值