<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration
PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<!-- local connection properties -->
<property name="hibernate.connection.url">
jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=t <!-- sql 2000 -->
<!-- jdbc:sqlserver://localhost:1433;DatabaseName=t sql 2005-->
</property>
<property name="hibernate.connection.driver_class">
com.microsoft.jdbc.sqlserver.SQLServerDriver <!-- sql 2000 -->
<!-- sql 2005 com.microsoft.sqlserver.jdbc.SQLServerDriver -->
</property>
<property name="hibernate.connection.username">sa</property>
<property name="hibernate.connection.password">sa</property>
<!-- property name="hibernate.connection.pool_size"></property -->
<!-- dialect for DB2 --><!--
<property name="dialect">
org.hibernate.dialect.DB2Dialect
</property>
--><property name="hibernate.show_sql">true</property>
<property name="hibernate.transaction.factory_class">
org.hibernate.transaction.JDBCTransactionFactory
</property>
<mapping resource="Person.hbm.xml" />
</session-factory>
</hibernate-configuration>
分享到:
相关推荐
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <!-- 必须配置 --> <property name="hibernate.connection.driver_class">...
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <!--Hibernate配置的根节点--> <session-factory> <!--配置SessionFactory--> <property name="dialect">...
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <!-- Database connection settings --> <property name="connection.driver_class">...
<hibernate-configuration> <session-factory> <!– 各属性的配置–> <!—为true表示将Hibernate发送给数据库的sql显示出来 –> ”show_sql”>true <!– SQL方言,这边设定的是MySQL –> ”dialect”>...
DOCTYPE hibernate-configuration (View Source for full doctype...)> - <!-- Generated by MyEclipse Hibernate Tools. --> - <hibernate-configuration> - <session-factory> ...
第一步:hibernate.cfg.xml 加入: <property name="hibernate.proxool.pool_alias">dbpool</property> <property name="hibernate.proxool.xml"> ProxoolConf.xml </property> ...
2.通过Hibernate执行SQL 2.1 创建session Configuration config = new Configuration(); config.configure(); SessionFactory sf = config.buildSessionFactory(); Session session = sf.openSession();
使用拦截器时按如下步骤进行: (1)定义实现Interceptor接口的拦截器类 (2)通过Session启用拦截器,或者通过Configuration启用全局拦截器请看示例代码
Session接口 Session接口负责执行被持久化对象的CRUD操作(CRUD的任务是完成与数据库的交流,包含了很多常见的SQL语句。)。但需要注意的是Session对象是非线程安全的。同时,Hibernate的session不同于JSP应用中的...
## DO NOT specify hibernate.connection.sqlDialect ## InterClient #hibernate.connection.driver_class interbase.interclient.Driver #hibernate.connection.url jdbc:interbase://localhost:3060/C:/firebird...
第24次课-1 Spring与Hibernate的整合 本节主要内容 24.1 概述 24.2 管理SessionFactory 24.3 Spring对Hibernate的简化 24.1 概述 24.1.1 概述 Spring提供了很多IoC特性的支持,方便处理大部分典型的Hibernate整合...
1.2.3. Hibernate configuration 1.2.4. Building with Ant 1.2.5. Startup and helpers 1.2.6. Loading and storing objects 1.3. Part 2 - Mapping associations 1.3.1. Mapping the Person class 1.3.2. A ...
Configuration接口负责配置并启动Hibernate,创建SessionFactory对象。在Hibernate的启动的过程中,Configuration类的实例首先定位映射文档位置、读取配置,然后创建SessionFactory对象。 Transaction接口 ...
property-ref:关联类中用于与主控类相关联的属性名,默认为关联类的主键属性名 单向一对多需在一方配置,双向一对多需在双方进行配置 8.lazy=false:被动方的记录由hibernate负责记取,之后存放在主控...
3.hibernate的配置文件(hibernate.cfg.xml)得存在 4.POJO.hbm.xml文件存在 5.hibernate的jar包以及数据库的驱动包存在 Hibernate的编程: 1.构建Configuration对象读取配置文件 2.读取映射文件 3.构建SessionFactory...
SQL Server 2000与以前版本相比较,又具有以下新特性 : 1.支持XML(Extensive Markup Language,扩展标记语言) 2.强大的基于Web的分析 3.支持OLE DB和多种查询 4.支持分布式的分区视图 安装、...
一个 Maven 插件,用于从 JPA+Hibernate 项目创建 DDL 文件。 用法 只需在pom.xml添加以下配置: <groupId>net.ggtools.maven</groupId> <artifactId>ddlgenerator-maven-plugin <version>0.1 <id>...
1.1.4. Hibernate configuration ............................................................................. 7 1.1.5. Building with Maven .................................................................
16.2. Disabling Specific Auto-configuration Classes 17. Spring Beans and Dependency Injection 18. Using the @SpringBootApplication Annotation 19. Running Your Application 19.1. Running from an IDE ...