spring的一些配置
来源:互联网 发布:熊猫tv抢佛跳墙软件 编辑:程序博客网 时间:2024/05/21 10:19
<?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"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd">
<!-- 扫描注解 -->
<context:component-scan base-package="com"></context:component-scan>
<!-- aop注解支持 -->
<aop:aspectj-autoproxy></aop:aspectj-autoproxy>
<!-- 开启事务注解驱动 -->
<tx:annotation-driven transaction-manager="tx"/>
<bean id="transDaoImpl" class="com.dao.impl.TransDaoImpl">
<property name="accountDaoImpl" ref="accountDaoImpl"></property>
</bean>
<bean id="accountDaoImpl" class="com.dao.impl.AccountDaoImpl">
<property name="dataSource" ref="dataSource"></property>
</bean>
<!-- 配置数据源 -->
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
<property name="url" value="jdbc:mysql:///lykj0904"></property>
<property name="username" value="root"></property>
<property name="password" value="root"></property>
</bean>
<!-- 配置事务管理器 -->
<bean id="tx"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"></property>
</bean>
</beans>
<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"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd">
<!-- 扫描注解 -->
<context:component-scan base-package="com"></context:component-scan>
<!-- aop注解支持 -->
<aop:aspectj-autoproxy></aop:aspectj-autoproxy>
<!-- 开启事务注解驱动 -->
<tx:annotation-driven transaction-manager="tx"/>
<bean id="transDaoImpl" class="com.dao.impl.TransDaoImpl">
<property name="accountDaoImpl" ref="accountDaoImpl"></property>
</bean>
<bean id="accountDaoImpl" class="com.dao.impl.AccountDaoImpl">
<property name="dataSource" ref="dataSource"></property>
</bean>
<!-- 配置数据源 -->
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
<property name="url" value="jdbc:mysql:///lykj0904"></property>
<property name="username" value="root"></property>
<property name="password" value="root"></property>
</bean>
<!-- 配置事务管理器 -->
<bean id="tx"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"></property>
</bean>
</beans>
阅读全文
0 0
- spring的一些配置
- spring的一些配置
- spring ibates 的一些配置
- spring的一些配置问题
- Spring 的一些随笔 一些配置说明
- spring applicationContext.xml的一些基本配置
- 关于spring配置的一些异常
- Spring的一些xml配置技巧
- spring boot的一些配置应用
- spring boot的一些配置二
- Spring Boot 一些常用的pom配置
- spring--bean 标签的一些属性的配置
- hibernate+spring+struts配置出的一些错误
- 配置Spring MVC 所遇到一些问题的总结
- 关于Spring整合数据源配置的一些收藏
- 关于spring+springMVC+myBatis的一些基础配置以及整合
- 关于spring+springMVC+myBatis的一些基础配置以及整合
- 关于spring+springMVC+myBatis的一些基础配置以及整合
- linux使用axel多线程下载文件
- Android与unity交互
- Mac OS下为Android Studio编译FFmpeg解码库的详细教程
- Apache POI 使用详情
- 用python中的递归画一棵小树
- spring的一些配置
- Java业务代理模式
- 74HC595芯片的应用实例
- Unity3D协程介绍 以及 使用
- 装修知识一
- java短信发送
- String,StringBuffer与StringBuilder的区别
- [POJ1717][luogu1282]Dominoes(多米诺骨牌)(dp)
- 深入浅出 消息队列 ActiveMQ