首页 > Web开发 > 详细

Hibernate基础(一)

时间:2016-01-19 12:37:09      阅读:235      评论:0      收藏:0      [点我收藏+]

Hibernate是ORM开源组件

源码:http://sourceforge.net/projects/hibernate/

 

1.Hibernate的配置文件.

默认配置文件: hibernate.cfg.xml

前期准备文件:hibernate.properties

其两个文件的开源项目文件夹的路径:hibernate-release-x.x.x\project\etc

 

技术分享

hibernate.cfg.xml文件的源码

<!--
  ~ 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 name="foo">
        <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
        <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
        <property name="connection.url">jdbc:mysql:///test</property>
        <property name="connection.username">xx</property>
        <property name="connection.password">xx</property>
    </session-factory>
</hibernate-configuration>

 

Hibernate基础(一)

原文:http://www.cnblogs.com/nidongde/p/5141651.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!