Warning: Attempt to read property "ID" on bool in /www/wwwroot/129.28.78.18/wp-content/themes/storeys-pro/wbc/components/og_schema/wb_og_schema.php on line 471

Warning: Attempt to read property "display_name" on bool in /www/wwwroot/129.28.78.18/wp-content/themes/storeys-pro/wbc/components/og_schema/wb_og_schema.php on line 480

Warning: Attempt to read property "display_name" on bool in /www/wwwroot/129.28.78.18/wp-content/themes/storeys-pro/wbc/components/og_schema/wb_og_schema.php on line 487

Warning: Attempt to read property "description" on bool in /www/wwwroot/129.28.78.18/wp-content/themes/storeys-pro/wbc/components/og_schema/wb_og_schema.php on line 489

Warning: Attempt to read property "ID" on bool in /www/wwwroot/129.28.78.18/wp-content/themes/storeys-pro/wbc/components/og_schema/wb_og_schema.php on line 493

邹瑞20201126

总结

JdbcTemplate

它是 spring 框架中提供的一个对象,是对原始 Jdbc API 对象的简单封装。spring 框架为我们提供了很 多的操作模板类。

操作关系型数据的:

JdbcTemplate

HibernateTemplate

操作 nosql 数据库的: RedisTemplate

操作消息队列的: JmsTemplate

我们今天的主角在 spring-jdbc-5.0.2.RELEASE.jar 中,我们在导包的时候,除了要导入这个 jar 包 外,还需要导入一个 spring-tx-5.0.2.RELEASE.jar (它是和事务相关的)。

Spring 中的事务控制

需明确:

第一:JavaEE 体系进行分层开发,事务处理位于业务层,Spring 提供了分层设计业务层的事务处理解 决方案。

第二:spring 框架为我们提供了一组事务控制的接口。具体在后面会介绍。这组接口是在 spring-tx5.0.2.RELEASE.jar 中。

第三:spring 的事务控制都是基于 AOP 的,它既可以使用编程的方式实现,也可以使用配置的方式实 现。我们学习的重点是使用配置的方式实现。

Spring 中事务控制的 API 介绍

PlatformTransactionManager

TransactionDefinition

评论留言