38 lines
1.8 KiB
XML
38 lines
1.8 KiB
XML
<?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:mvc="http://www.springframework.org/schema/mvc"
|
||
xsi:schemaLocation="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.0.xsd
|
||
http://www.springframework.org/schema/context
|
||
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
|
||
<context:annotation-config />
|
||
|
||
<!-- c3p0连接池配置 -->
|
||
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
|
||
<!-- 用户名 -->
|
||
<property name="user" value="trustie" />
|
||
<!-- 用户密码 -->
|
||
<property name="password" value="1234" />
|
||
<property name="driverClass" value="com.mysql.jdbc.Driver" />
|
||
<property name="jdbcUrl"
|
||
value="jdbc:mysql://192.168.80.130:3306/ossean_production?useUnicode=true&characterEncoding=utf-8" />
|
||
|
||
<!--连接池中保留的最大连接数。默认值: 15 -->
|
||
<property name="maxPoolSize" value="10" />
|
||
<!-- 连接池中保留的最小连接数,默认为:3 -->
|
||
<property name="minPoolSize" value="5" />
|
||
<!-- 初始化连接池中的连接数,取值应在minPoolSize与maxPoolSize之间,默认为3 -->
|
||
<property name="initialPoolSize" value="5" />
|
||
|
||
<!--最大空闲时间,60秒内未使用则连接被丢弃。若为0则永不丢弃。默认值: 0 -->
|
||
<property name="maxIdleTime" value='60' />
|
||
<property name="maxStatements" value='100' />
|
||
<property name="maxStatementsPerConnection" value='20' />
|
||
|
||
</bean>
|
||
<!--context:component-scan base-package="net.trustie.webmagic.dao"/ -->
|
||
</beans>
|