<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
	xmlns:p="http://www.springframework.org/schema/p" xmlns:tx="http://www.springframework.org/schema/tx"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:mvc="http://www.springframework.org/schema/mvc" 
	xsi:schemaLocation="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 
						http://www.springframework.org/schema/aop 
						http://www.springframework.org/schema/aop/spring-aop-3.0.xsd 
						http://www.springframework.org/schema/tx 
						http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
						http://www.springframework.org/schema/mvc   
      					http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
	

	<!-- 数据库连接池配置 -->
  <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
<!--     <property name="driverClass" value="org.sqlite.JDBC" /> -->
<!--     <property name="jdbcUrl" value="jdbc:sqlite:matrix_db" /> -->
    <property name="driverClass" value="${dataSource.driverClass}" />
    <property name="jdbcUrl" value="${dataSource.jdbcUrl}" />
<!--     <property name="jdbcUrl" value="jdbc:mysql://172.31.35.6:3306/baiwei?useUnicode=true&amp;characterEncoding=UTF-8&amp;relaxAutoCommit=true&amp;zeroDateTimeBehavior=convertToNull" /> -->
    <property name="user" value="${dataSource.user}"/>
    <property name="password" value="${dataSource.password}"/>
<!--     <property name="password" value="1234"/> -->
    <!-- 连接池中保留的最小连接数 -->
    <property name="minPoolSize" value="1" />
    <!-- 连接池中保留的最大连接数 -->
    <property name="maxPoolSize" value="10" />
    <!-- 初始化时获取5个连接，取值应在minPoolSize与maxPoolSize之间 -->
    <property name="initialPoolSize" value="5" />
    <!-- 最大空闲时间,3000秒内未使用则连接被丢弃。若为0则永不丢弃 -->
    <property name="maxIdleTime" value="3000" />
    <property name="loginTimeout" value="5000" />
    <!-- 当连接池中的连接耗尽的时候c3p0一次同时获取的连接数 -->
    <property name="acquireIncrement" value="5" />
    <!-- 每60秒检查所有连接池中的空闲连接 -->
    <property name="idleConnectionTestPeriod" value="60" />
    <!-- 当连接池用完时客户端调用getConnection()后等待获取新连接的时间 0为无限期等待 -->
    <property name="checkoutTimeout" value="6000" />
  </bean>


	<bean id="queryRunner" class="org.apache.commons.dbutils.QueryRunner" >  
		<constructor-arg>  
			<ref bean="dataSource"/>  
		</constructor-arg>  
	</bean> 

	<bean id="commonBaseDao" class="co.dc.commons.basedao.CommonBaseDao" >  
        <constructor-arg>  
            <ref bean="dataSource"/>  
        </constructor-arg>  
    </bean> 
	
	
	
</beans>
