Hibernate配置文件之hibernate.cfg.xml
来源:互联网 发布:java ee和java web 编辑:程序博客网 时间:2024/04/29 14:28
记录Hibernate的配置文件
以连接MySQL数据库为例
<?xml version="1.0" encoding="UTF-8"?><!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> <!-- 连接数据库的信息 --> <!-- mysql驱动信息 --> <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property> <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/Blog_DB</property> <!-- mysql数据库用户名 --> <property name="hibernate.connection.username">root</property> <!-- mysql数据库密码 --> <property name="hibernate.connection.password">19920902</property> <!-- 数据库的方言:根据底层的数据库生成不同的SQL --> <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property> <!-- 配置显示SQL --> <property name="hibernate.show_sql">true</property> <!-- 配置格式化SQL --> <property name="hibernate.format_sql">true</property> <!-- 连接池配置 --><!-- <property name="hibernate.connection.provider_class">org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider</property> --> <property name="connection.pool_size">1</property> <!--在连接池中可用的数据库连接的最少数目 --> <property name="c3p0.min_size">5</property> <!--在连接池中所有数据库连接的最大数目 --> <property name="c3p0.max_size">20</property> <!--设定数据库连接的过期时间,以秒为单位, 如果连接池中的某个数据库连接处于空闲状态的时间超过了timeout时间,就会从连接池中清除 --> <property name="c3p0.timeout">120</property> <!--每3000秒检查所有连接池中的空闲连接 以秒为单位--> <property name="c3p0.idle_test_period">3000</property> <!-- 加载映射文件 --> <mapping resource="com/itschy/Model/User.hbm.xml"/> </session-factory></hibernate-configuration>
阅读全文
0 0
- hibernate 配置文件之hibernate.cfg.xml说明
- hibernate 配置文件之hibernate.cfg.xml说明
- Hibernate配置文件之hibernate.cfg.xml
- Hibernate学习之配置文件hibernate.cfg.xml
- hibernate.cfg.xml 配置文件
- hibernate.cfg.xml配置文件
- hibernate.cfg.xml配置文件
- hibernate.cfg.xml配置文件
- Hibernate.cfg.xml配置文件
- Hibernate.cfg.xml配置文件
- hibernate.cfg.xml配置文件
- hibernate.cfg.xml 配置文件
- hibernate配置文件hibernate.cfg.xml
- hibernate配置文件--hibernate.cfg.xml
- Hibernate配置文件hibernate.cfg.xml
- Hibernate-配置文件-hibernate.cfg.xml
- Hibernate 配置文件:hibernate.cfg.xml
- Hibernate配置文件(Hibernate.cfg.xml)
- 6个编写优质干净代码的技巧
- 黑色星期五
- 基于C语言链表实现的工作任务注册与执行
- 多线程
- elasticsearch集群内的原理
- Hibernate配置文件之hibernate.cfg.xml
- java学习初探十三之集合—Set详解
- js单例模式
- iOS【Xcode 清理缓存、删除多余provisioning profile 证书】
- Handler由浅入深(一)--Handler的基本使用
- CornerStone SVN报错 The working copy is locked due to a previous error
- Linux基本命令(一)
- POJ
- 用Python进行数据挖掘的前奏----了解Python的语法