dataSource(阿里巴巴)的配置

来源:互联网 发布:淘宝店铺招牌制作软件 编辑:程序博客网 时间:2024/06/08 02:54
<?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"    xsi:schemaLocation="http://www.springframework.org/schema/beans         http://www.springframework.org/schema/beans/spring-beans-3.2.xsd         http://www.springframework.org/schema/context         http://www.springframework.org/schema/context/spring-context-3.2.xsd         http://www.springframework.org/schema/aop         http://www.springframework.org/schema/aop/spring-aop-3.2.xsd         http://www.springframework.org/schema/tx         http://www.springframework.org/schema/tx/spring-tx-3.2.xsd ">    <!-- 阿里巴巴数据库连接池 dbcp/c3p0/druid -->    <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource"        init-method="init" destroy-method="close">        <property name="url"            value="jdbc:mysql://127.0.0.1:3306/ssm_oa?useUnicode=true&amp;characterEncoding=utf8&amp;zeroDateTimeBehavior=convertToNull" />        <property name="username" value="root" />        <property name="password" value="111" />        <property name="filters" value="stat" />        <property name="maxActive" value="20" />        <property name="initialSize" value="10" />        <property name="maxWait" value="60000" />        <property name="minIdle" value="5" />        <property name="timeBetweenEvictionRunsMillis" value="3000" />        <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="100" />    </bean></beans>
原创粉丝点击