spring
圣☞摧枯拉朽
大数据
展开
-
SSM整合开发。
SSM整合开发SSM: SpringMVC + Spring + MyBatis.SpringMVC:视图层,界面层,负责接收请求,显示处理结果的。Spring:业务层,管理service,dao,工具类对象的。MyBatis:持久层, 访问数据库的用户发起请求--SpringMVC接收--Spring中的Service对象--MyBatis处理数据SSM整合也叫做SSI (IBatis也就是mybatis的前身), 整合中有容器。1.第一个容器SpringMVC容器, 管理Contr.原创 2020-09-10 11:43:59 · 125 阅读 · 0 评论 -
idea run配置
原创 2020-09-07 17:34:25 · 1545 阅读 · 0 评论 -
Spring中的声明式事务管理
1)配置信息中引入事务的命名空间xmlns:tx="http://www.springframework.org/schema/tx"http://www.springframework.org/schema/txhttp://www.springframework.org/schema/tx/spring-tx.xsd2)启用事务:用注解驱动的方式来管理事务 <tx:annotation-driven/>3)在 spring.xml 中配置事务...原创 2020-09-04 13:41:19 · 123 阅读 · 0 评论 -
spring 事务
package com.yw.spring.tx.annotation.service;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.stereotype.Service;import org.springframework.transaction.annotation.Isolation;import org.springframework.transaction.原创 2020-09-03 10:09:53 · 74 阅读 · 0 评论 -
spring 日志切面
package com.atguigu.spring.aspectJ.annotation;import java.util.Arrays;import org.aspectj.lang.JoinPoint;import org.aspectj.lang.ProceedingJoinPoint;import org.aspectj.lang.annotation.After;import org.aspectj.lang.annotation.AfterReturning;import o.原创 2020-09-03 09:40:23 · 367 阅读 · 0 评论 -
spring 事务中Propagation取值的含义
REQUIRED:支持当前事务,如果当前没有事务,就新建一个事务。这是最常见的选择。 requiredSUPPORTS:支持当前事务,如果当前没有事务,就以非事务方式执行。 supportsMANDATORY:支持当前事务,如果当前没有事务,就抛出异常。 mandatoryREQUIRES_NEW:新建事务,如果当前存在事务,把当前事务挂起。 requires_newNOT_SUPPORTED:以非事务方式执行操作,如果当前存在事务,就把当前事务挂起。 not_supportedNEVER:以非.原创 2020-08-25 08:29:25 · 150 阅读 · 0 评论 -
@Qualifier来进一步指定要装配的bean
默认情况下,使用@Autowired标注的属性必须被装配,如果装配不了,也会抛出异常.可以使用required=false来设置不是必须要被装配.如果匹配到多个兼容类型的bean,可以使用@Qualifier来进一步指定要装配的bean的id值 。@Autowired(required=false) // 自动装配 byName byType ?????@Qualifier("userDaoJdbcImpl")private UserDao userDao ; Use...原创 2020-08-24 20:38:28 · 535 阅读 · 0 评论 -
spring ——声明式事务管理
package com.atguigu.spring.tx.annotation.service;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.stereotype.Service;import org.springframework.transaction.annotation.Isolation;import org.springframework.transac原创 2020-08-24 11:34:25 · 98 阅读 · 0 评论 -
spring ——jdbc、JdbcTemplate
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="h...原创 2020-08-24 11:17:41 · 119 阅读 · 0 评论