hibernate设置
2015-12-18 15:13
246 查看
<!-- ~ Hibernate, Relational Persistence for Idiomatic Java ~ ~ License: GNU Lesser General Public License (LGPL), version 2.1 or later. ~ See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. --> <!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="dialect">org.hibernate.dialect.MySQL5Dialect</property> <property name="connection.driver_class">com.mysql.jdbc.Driver</property> <property name="connection.url">jdbc:mysql://localhost:3306/hiblicc</property> <property name="connection.username">root</property> <property name="connection.password">123456</property> <!-- 导入映射配置文件 --> <!-- <mapping resource="com/hiblicc/user/User.hbm.xml"/> --> <mapping class="com.hiblicc.user.User"/> </session-factory> </hibernate-configuration>
<数据库连接信息>
1设置方言
2设置mysql驱动类
3设置数据库连接地址路径
4设置数据库登录用户名
5设置数据库登录密码
<导入映射配置>
<pre name="code" class="java"><mapping resource="com/hiblicc/user/User.hbm.xml"/>//这是是使用配置文件的配置
<pre name="code" class="java"><mapping class="com.hiblicc.user.User"/>使用注解直接把类写上
相关文章推荐
- Xcode快捷键
- PHP 7問世,2億網站效能翻倍有望
- Java模拟post提交表单数据
- bzoj 2038: [2009国家集训队]小Z的袜子(hose) 莫队算法
- Linux系统下安装rz/sz命令及使用说明
- 学习编译volley为jar包
- CocoaPods安装与使用
- 对Map中数据,按value值排序方法
- TableViewCell高度的自适应
- 黑马程序员————Java基础之多线程
- Android 常用开发工具类
- DevExpress
- 手游寒冬季如何通过包压缩技术规避项目损失?
- JavaMail 发送邮件
- -webkit-overflow-scrolling
- 条码解析的一片js
- PHP底层的运行机制与原理
- Resource(2)
- 这是一场关乎于前沿思想的说明会
- Android开发manifest.xml文件不常用属性