Hibernate4中hibernate.cfg.xml文件的配置
来源:互联网 发布:穿越火线m4a1千变数据 编辑:程序博客网 时间:2024/05/18 05:22
<?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>
<!-- DB连接四要素 -->
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:数据库端口号/数据库名称</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">root</property>
<!-- 方言 -->
<property name="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</property>
<!--C3P0 数据源(数据库连接池) -->
<property name="hibernate.connection.provider_class">org.hibernate.c3p0.internal.C3P0ConnectionProvider</property>
<!-- 当前Session上下文 -->
<property name="hibernate.current_session_context_class">thread</property>
<!-- 自动建表 -->
<property name="hibernate.hbm2ddl.auto">update</property>
<!-- 显示SQL -->
<property name="hibernate.show_sql">true</property>
<!-- 格式化SQL -->
<property name="hibernate.format_sql">true</property>
<!-- 注册映射文件 -->
<mapping resource="com/luo/beans/Student.hbm.xml"/>
</session-factory>
</hibernate-configuration>
<!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>
<!-- DB连接四要素 -->
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:数据库端口号/数据库名称</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">root</property>
<!-- 方言 -->
<property name="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</property>
<!--C3P0 数据源(数据库连接池) -->
<property name="hibernate.connection.provider_class">org.hibernate.c3p0.internal.C3P0ConnectionProvider</property>
<!-- 当前Session上下文 -->
<property name="hibernate.current_session_context_class">thread</property>
<!-- 自动建表 -->
<property name="hibernate.hbm2ddl.auto">update</property>
<!-- 显示SQL -->
<property name="hibernate.show_sql">true</property>
<!-- 格式化SQL -->
<property name="hibernate.format_sql">true</property>
<!-- 注册映射文件 -->
<mapping resource="com/luo/beans/Student.hbm.xml"/>
</session-factory>
</hibernate-configuration>
0 1
- Hibernate4中hibernate.cfg.xml文件的配置
- Hibernate4中hibernate.cfg.xml文件的配置
- hibernate.cfg.xml文件的配置
- Hibernate.cfg.xml文件的配置
- Hibernate.cfg.xml文件的配置
- hibernate.cfg.xml文件的配置问题
- Hibernate.cfg.xml文件的配置
- hibernate+sqlserver2005连接对hibernate.cfg.xml文件的配置
- Hibernate框架中hibernate.properties属性文件,hibernate.cfg.xml配置文件,以及Users.hbm.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配置
- Android Handler的内部原理
- Java - Nuc - 郭姐散步 ( 矩阵快速幂 )
- 【ROS学习】(十一)常见问题及解决方案
- C++ 构造函数与析构函数
- Unity中有两种Animation Clip
- Hibernate4中hibernate.cfg.xml文件的配置
- MongoVUE已连接MongoDB,但是,用MongoVUE,看不到MongoDB数据库中的数据,日志报错: “Failed to authenticate root@dataPlantform
- JAVA中this用法小结
- 公车转瞬即逝
- Linux账号管理的相关命令
- opencv 基于sift的多张图片全景图拼接
- Java泛型的优点
- 【项目总结】软件工程之C/S学习
- mac windows蓝牙问题