SSH 整合
1、Spring 与 Hibernate 整合
-- 复习
-- 新建工程 ssh
-- 将 MySQL 的驱动 jar 包复制到 lib 目录
-- 导入 Spring 框架(需要引入 5 个库)
-- 导 入 Hibernate 框 架 ( 最 后 一 步 : 不 创 建
HibernateSessionFactory 类)
-- Spring 与 Hibernate 的整合
整 合 方 案 : 主 要 是 在 Spring 的 配 置 文 件
(applicationContext.xml)中进行
1) 配置事务管理器,使用的类为:
org.springframework.orm.hibernate3.Hibernat
eTransactionManager
2)配置事务
I)在 applicationContext.xml 中引入事务(tx)的命名空间
xmlns:tx="http://www.springframework.org/sc
hema/tx"
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/sp
ring-tx-3.0.xsd