1. 程式人生 > >mybatis連線池配置

mybatis連線池配置

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<environments default="dev">
<environment id="dev">
<!--
JDBC:由資料庫進行事務管理
MANAGED:由web容器進行事務管理
-->
<transactionManager type="JDBC"/>
<!-- 使用連線池 -->
<dataSource type="POOLED">
<property name="driver" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://172.16.4.106:3306/bmac_reportcenter"/>
<property name="username" value="root"/>
<property name="password" value="root"/>

<property name="poolMaximumIdleConnections" value="20"/>
<property name="poolMaximumActiveConnections" value="500"/>
<property name="poolPingEnabled" value="true" />

</dataSource>
</environment>
</environments>
<!-- 載入對映檔案 -->
<mappers >
<mapper resource="mapper/SoAndroidHourMapper.xml"/>
</mappers>
</configuration>