123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- <?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:p="http://www.springframework.org/schema/p"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
- xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:cache="http://www.springframework.org/schema/cache"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
- http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
- http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
- http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
- http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache-3.1.xsd">
- <bean id="propertyConfigurer"
- class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
- <property name="locations">
- <list>
- <value>classpath:dbconfig.properties</value>
- </list>
- </property>
- </bean>
- <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource"
- destroy-method="close">
- <property name="url" value="${url}" />
- <property name="username" value="${username}" />
- <property name="password" value="${password}" />
- <property name="driverClassName" value="${driverClassName}" />
- <property name="maxActive" value="${maxActive}" />
- <property name="initialSize" value="${initialSize}" />
- <property name="maxWait" value="${maxWait}" />
- <property name="minIdle" value="${minIdle}" />
- <property name="timeBetweenEvictionRunsMillis" value="${timeBetweenEvictionRunsMillis}" />
- <property name="minEvictableIdleTimeMillis" value="${minEvictableIdleTimeMillis}" />
- <property name="testWhileIdle" value="${testWhileIdle}" />
- <property name="testOnBorrow" value="${testOnBorrow}" />
- <property name="testOnReturn" value="${testOnReturn}" />
- <property name="maxOpenPreparedStatements" value="${maxOpenPreparedStatements}" />
- <property name="removeAbandoned" value="${removeAbandoned}" />
- <property name="removeAbandonedTimeout" value="${removeAbandonedTimeout}" />
- <property name="logAbandoned" value="${logAbandoned}" />
- <property name="proxyFilters">
- <list>
- <ref bean="wall-filter"/>
- </list>
- </property>
- </bean>
- <!-- 创建SqlSessionFactory,同时指定数据源 -->
- <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
- <property name="dataSource" ref="dataSource" />
- <property name="configLocation" value="classpath:mybatis-config.xml" />
- </bean>
- <!-- Spring自动扫描MybatisMapper文件 -->
- <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
- <property name="basePackage" value="com.tqe.dao" />
- </bean>
- <bean id="wall-filter" class="com.alibaba.druid.wall.WallFilter">
- <property name="dbType" value="mysql" />
- <property name="config" ref="wall-filter-config" />
- <property name="throwException" value="false"/>
- </bean>
- <bean id="wall-filter-config" class="com.alibaba.druid.wall.WallConfig" init-method="init">
- <property name="selectWhereAlwayTrueCheck" value="false"/>
- <property name="selectUnionCheck" value="false"/>
- <property name="dir" value="META-INF/druid/wall/mysql" />
- </bean>
-
- </beans>
-
-
|