<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
@H_404_5@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
@H_404_5@ xmlns:context="http://www.springframework.org/schema/context"
@H_404_5@ xmlns:mvc="http://www.springframework.org/schema/mvc"
@H_404_5@ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
@H_404_5@ <!--配置service的包扫描,自动注入Service-->
@H_404_5@ <context:component-scan base-package="com.simple"/>
@H_404_5@ <!-- 使用spring自带的占位符替换功能 -->
@H_404_5@ <bean
@H_404_5@ class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
@H_404_5@ <!-- 允许JVM参数覆盖 -->
@H_404_5@ <property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
@H_404_5@ <!-- 忽略没有找到的资源文件 -->
@H_404_5@ <property name="ignoreResourceNotFound" value="true" />
@H_404_5@ <property name="locations">
@H_404_5@ <list>
@H_404_5@ <value>classpath:jdbc.properties</value>
@H_404_5@ <value>classpath:env.properties</value>
@H_404_5@ </list>
@H_404_5@ </property>
@H_404_5@ </bean>
@H_404_5@ <bean id="dataSource" class="com.jolBox.bonecp.BoneCPDataSource"
@H_404_5@ destroy-method="close">
@H_404_5@ <property name="driverClass" value="${jdbc.driver}" />
@H_404_5@ <!-- 相应驱动的jdbcUrl -->
@H_404_5@ <property name="jdbcUrl" value="${jdbc.url}" />
@H_404_5@ <property name="username" value="${jdbc.username}" />
@H_404_5@ <property name="password" value="${jdbc.password}" />
@H_404_5@ <!-- 检查数据库连接池中空闲连接的间隔时间,单位是分,默认值:240,如果要取消则设置为0 -->
@H_404_5@ <property name="idleConnectionTestPeriod" value="60" />
@H_404_5@ <!-- 连接池中未使用的链接最大存活时间,单位是分,默认值:60,如果要永远存活设置为0 -->
@H_404_5@ <property name="idleMaxAge" value="30" />
@H_404_5@ <!-- 每个分区最大的连接数 -->
@H_404_5@ <property name="maxConnectionsPerPartition" value="150" />
@H_404_5@ <!-- 每个分区最小的连接数 -->
@H_404_5@ <property name="minConnectionsPerPartition" value="5" />
@H_404_5@ </bean>
</beans>
原文链接:https://www.f2er.com/xml/296119.html