schema

来源:互联网 发布:hec hms软件说明书 编辑:程序博客网 时间:2024/05/08 03:22
<?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:aop="http://www.springframework.org/schema/aop"       xmlns:tx="http://www.springframework.org/schema/tx"       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/aop        http://www.springframework.org/schema/aop/spring-aop.xsd        http://www.springframework.org/schema/tx        http://www.springframework.org/schema/tx/spring-tx.xsd">    <!--自动扫描Spring注解-->    <context:component-scan base-package="com.sun"/>    <!--Sping AOP注解扫描-->    <aop:aspectj-autoproxy/>    <!--Spring的属性加载器,加载properties文件中的属性-->    <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">        <property name="locations">            <value>properties/*.properties</value>        </property>        <property name="fileEncoding" value="utf-8"/>    </bean>    <!--配置spring dataSource 数据池连接-->    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">        <property name="driverClassName" value="${jdbc.driverClassName}" />        <property name="url" value="${jdbc.url}" />        <property name="username" value="${jdbc.username}" />        <property name="password" value="${jdbc.password}" />    </bean>    <!-- 定义JdbcTemplateBean -->    <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">        <property name="dataSource" ref="dataSource"/>    </bean>    <!--配置事务管理器-->    <bean id="txManage" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">        <property name="dataSource" ref="dataSource"/>    </bean>    <!--开启事务注解扫描-->    <tx:annotation-driven transaction-manager="txManage"/></beans>
0 0
原创粉丝点击