<?xml version="1.0" encoding="UTF-8"?>
|
<beans xmlns="http://www.springframework.org/schema/beans"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
|
|
<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close">
|
<property name="url" value="jdbc:mysql://47.96.26.152:3306/monitor?characterEncoding=UTF-8"/>
|
<property name="username" value="root"/>
|
<property name="password" value="xOlx8z9L7Pt6y9YI"/>
|
<property name="initialSize" value="1" />
|
<property name="minIdle" value="1" />
|
<property name="maxActive" value="20" />
|
<property name="maxWait" value="60000" />
|
<property name="timeBetweenEvictionRunsMillis" value="60000" />
|
<property name="minEvictableIdleTimeMillis" value="300000" />
|
<property name="validationQuery" value="SELECT 'x'" />
|
<property name="testWhileIdle" value="true" />
|
<property name="testOnBorrow" value="false" />
|
<property name="testOnReturn" value="false" />
|
<property name="poolPreparedStatements" value="true" />
|
<property name="maxPoolPreparedStatementPerConnectionSize" value="20" />
|
<property name="filters" value="stat" />
|
</bean>
|
|
<bean id="sqlSessionFactoryMain" name="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
|
<property name="configLocation" value="classpath:mybatis/mybatis.xml"/>
|
<property name="mapperLocations" value="classpath:mapper/*.xml" />
|
<property name="dataSource" ref="dataSource"/>
|
</bean>
|
|
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
|
<property name="dataSource" ref="dataSource"/>
|
</bean>
|
|
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
|
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactoryMain"/>
|
<property name="basePackage" value="com.moral.monitor.dao"/>
|
</bean>
|
</beans>
|