spring引入HikariCP连接池

1、导入jar包

2、applicationContext.xml中配置

<bean id="dataSource" class="com.zaxxer.hikari.HikariDataSource"
        destroy-method="shutdown">
        <property name="driverClassName" value="${data.driverClassName}"></property>
        <property name="jdbcUrl" value="${data.url}"></property>
        <property name="username" value="${data.username}"></property>
        <property name="password" value="${data.password}"></property>
        <property name="readOnly" value="false" />
        <property name="connectionTimeout" value="30000" />
        <property name="idleTimeout" value="600000" />
        <property name="maxLifetime" value="1800000" />
        <property name="maximumPoolSize" value="15" />
    </bean> 

3、据说HikariCP是目前性能最好的连接池

posted @ 2018-06-13 14:24  非非是  阅读(3012)  评论(0编辑  收藏  举报