![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
spring
liuestc
这个作者很懒,什么都没留下…
展开
-
事务处理
@Transactional(value = "txManager", propagation = Propagation.REQUIRED, rollbackFor = Exception.class)public exampleMethod()throws EXCEPTION{try{}catch(exceptions e){do work()//如果这里未抛出异常是不会回滚操作的数据的;th...原创 2016-09-11 21:01:38 · 67 阅读 · 0 评论 -
spring注解
使用 @Repository、@Service、@Controller 和 @Component 将类标识为 Bean,他们的作用,区别是什么?在哪些情况下使用哪些?有哪些属性可以进行配置,这些属性的作用是什么? @Repository 只能标注在 DAO 类上呢?这是因为该注解的作用不只是将类识别为 Bean,同时它还能将所标注的类中抛出的数据访问异常封装为 Spring 的数据访问...原创 2016-11-18 15:05:11 · 93 阅读 · 0 评论 -
spring jdbc配置(oracle)
主要有四种 :spring自带的JDBC、DBCP数据源、 C3P0数据源、jndi数据源: 1、spring自带的JDBC配置,只需要引入ojdbcjar包即可; xml文件中按如下配置 <bean id="dataSourceSpring" class="org.springframework.jdbc.datasource.DriverManagerDataSour...原创 2016-11-28 10:06:19 · 742 阅读 · 0 评论