<?xml version="1.0" encoding="UTF-8"?>
<!--指定该文件的官方dtd-->
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd" >
<hibernate-configuration>
<session-factory>
<!-- 显示sql语言 -->
<property name="show_sql">true</property>
<!-- sql语言 -->
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<!-- jdbc驱动程式 -->
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<!-- jdbc url -->
<property name="connection.url">jdbc:mysql://localhost:3306/test</property>
<!-- 数据库用户名 -->
<property name="connection.username">root</property>
<!-- 数据库密码 -->
<property name="connection.password">wyq</property>
<!-- C3P0连接池设定 -->
<!--最小连接数-->
<property name="c3p0.min_size">5</property>
<!--最大连接数-->
<property name="c3p0.max_size">20</property>
<!--延迟所允许的时间-->
<property name="c3p0.timeout">1800</property>
<!--缓存所允许的最大连接数-->
<property name="c3p0.max_statements">50</property>
<!-- 每隔100笔资料送入资料库,清除缓存(定期清除缓存,减小压力) -->
<property name="hibernate.jdbc.batch_size">100</property>
<!-- 设定事务管理的工厂类 -->
<property name="hibernate.transaction.factiory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
<mapping resource="com/wyq/hibernate/pojo/User.hbm.xml"/>
<mapping resource="com/wyq/hibernate/pojo/TUser.hbm.xml"/>
<mapping resource="com/wyq/hibernate/pojo/Room.hbm.xml"/>
</session-factory>
</hibernate-configuration>
需要的jar包有c3p0.jar,hibernate3.jar,数据库.jar,log4j.jar
- 大小: 2.1 MB
- 大小: 2.1 MB
分享到:
相关推荐
Hibernate配置文件hibernate.cfg.xml中配置信息详解!
hibernate.cfg.xml hibernate框架的配置文件
高级Hibernate4开发技术:ORM思想,hibernate介绍,hibernate.cfg.xml配置,hbm.xml映射文件详解,主键生成策略使用,PO对象状态及状态的转换分析、一级缓存,Hibernate数据检索技术,Hibernate高级映射技术,...
由于spring对hibernate配置文件hibernate.cfg.xml的集成相当好,可以在项目中放弃hibernate.cfg.xml文件,介绍mappingLocations、mappingDirectoryLocations与mappingJarLocations的用法和区别
高级Hibernate4开发技术:ORM思想,hibernate介绍,hibernate.cfg.xml配置,hbm.xml映射文件详解,主键生成策略使用,PO对象状态及状态的转换分析、一级缓存,Hibernate数据检索技术,Hibernate高级映射技术,...
这是Hibernate的配置文件,hibernate.cfg.xml的具体写法,共友友们参考~~谢谢~
hibernate配置文件hibernate.cfg.xml的详细解释
Hibernate.cfg.xml配置文件
继续在 LocalSessionFactoryBean 中配置,使用hibernateProperties属性继续来配置其他的属性,注意值是properties属性文件
Hibernate4的全套jar包,及hbm.xml(模板)+hibernate.cfg.xml(模板)+c3p0(全套)+ojdbc14.jar
用于配置hibernate.cfg.xml和相当的应用,值得看看.........
hibernate的xml文件配置 其中里面每个配置点都有详细说明
读取并解析hibernate.cfg.xml配置文件 2.由hibernate.cfg.xml中的<mapping resource="com/xx/User.hbm.xml"/>读取并解析映射信息 3.通过config.buildSessionFactory();//创建SessionFactory 4.sessionFactory....
2.1、将“hibernate\hibernate.cfg.xml”拷贝到“\WEB-INF\classes”文件夹下,替换原先的文件。 2.2、打开此文件,将“<property name="hibernate.connection.url">jdbc:sqlite:D:/EGSDatabase.egsdata”一行中的...
在 javaweb 开发时会用到三大框架ssh 其中hibernate的使用要先配置一下映射的文件,你可以通过下载此代码作为参考
Hibernate所需共19个jar包,已经修改好的hibernate.cfg.xml文件
NHibernate3.2源程序,还带例子源程序,都是从网上找的,原带的用配置文件hibernate.cfg.xml实来现。DiPiPiDemo的实现不用hibernate.cfg.xml配置文件,这样可以把配置放到任何地方,还可以加密。很有用处。
读取并解析hibernate.cfg.xml配置文件 2.由hibernate.cfg.xml中的<mapping resource="com/xx/User.hbm.xml"/>读取并解析映射信息 3.通过config.buildSessionFactory();//创建SessionFactory 4.sessionFactory....