您好,登錄后才能下訂單哦!
https://www.jianshu.com/p/15b846107a7c
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>3.3.1</version>
</dependency>
<bean id="dataSource" class="com.zaxxer.hikari.HikariDataSource" destroy-method="shutdown">
<property name="driverClassName" value="${jdbc.driver}" />
<property name="jdbcUrl" value="${jdbc.url}" />
<property name="username" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
<property name="connectionTestQuery" value="SELECT 1" />
<!-- 生效超時 -->
<property name="validationTimeout" value="3000" />
<!-- 連接只讀數據庫時配置為true, 保證安全 -->
<property name="readOnly" value="false" />
<!-- 等待連接池分配連接的最大時長(毫秒),超過這個時長還沒可用的連接則發生SQLException, 缺省:30秒 -->
<property name="connectionTimeout" value="60000" />
<!-- 一個連接idle狀態的最大時長(毫秒),超時則被釋放(retired),缺省:10分鐘 -->
<property name="idleTimeout" value="60000" />
<!-- 一個連接的生命時長(毫秒),超時而且沒被使用則被釋放(retired),缺省:30分鐘,建議設置比數據庫超時時長少30秒,參考MySQL
wait_timeout參數(show variables like '%timeout%';) -->
<property name="maxLifetime" value="60000" />
<!-- 連接池中允許的最大連接數。缺省值:10;推薦的公式:((core_count * 2) + effective_spindle_count) -->
<property name="maximumPoolSize" value="10" />
</bean>
17:36:50.838 [main] WARN com.zaxxer.hikari.HikariConfig - HikariPool-1 - idleTimeout has been set but has no effect because the pool is operating as a fixed size pool.
17:36:50.838 [main] DEBUG com.zaxxer.hikari.HikariConfig - HikariPool-1 - configuration:
17:36:50.841 [main] DEBUG com.zaxxer.hikari.HikariConfig - allowPoolSuspension.............false
17:36:50.841 [main] DEBUG com.zaxxer.hikari.HikariConfig - autoCommit......................true
17:36:50.841 [main] DEBUG com.zaxxer.hikari.HikariConfig - catalog.........................none
17:36:50.841 [main] DEBUG com.zaxxer.hikari.HikariConfig - connectionInitSql...............none
17:36:50.841 [main] DEBUG com.zaxxer.hikari.HikariConfig - connectionTestQuery............."SELECT 1"
17:36:50.841 [main] DEBUG com.zaxxer.hikari.HikariConfig - connectionTimeout...............60000
17:36:50.841 [main] DEBUG com.zaxxer.hikari.HikariConfig - dataSource......................none
17:36:50.841 [main] DEBUG com.zaxxer.hikari.HikariConfig - dataSourceClassName.............none
17:36:50.841 [main] DEBUG com.zaxxer.hikari.HikariConfig - dataSourceJNDI..................none
17:36:50.843 [main] DEBUG com.zaxxer.hikari.HikariConfig - dataSourceProperties............{password=<masked>}
17:36:50.843 [main] DEBUG com.zaxxer.hikari.HikariConfig - driverClassName................."com.mysql.jdbc.Driver"
17:36:50.843 [main] DEBUG com.zaxxer.hikari.HikariConfig - healthCheckProperties...........{}
17:36:50.843 [main] DEBUG com.zaxxer.hikari.HikariConfig - healthCheckRegistry.............none
17:36:50.843 [main] DEBUG com.zaxxer.hikari.HikariConfig - idleTimeout.....................60000
17:36:50.843 [main] DEBUG com.zaxxer.hikari.HikariConfig - initializationFailTimeout.......1
17:36:50.843 [main] DEBUG com.zaxxer.hikari.HikariConfig - isolateInternalQueries..........false
17:36:50.843 [main] DEBUG com.zaxxer.hikari.HikariConfig - jdbcUrl.........................jdbc:mysql://ykx.uerp.net:3306/ykx?useUnicode=true&characterEncoding=utf8
17:36:50.843 [main] DEBUG com.zaxxer.hikari.HikariConfig - leakDetectionThreshold..........0
17:36:50.843 [main] DEBUG com.zaxxer.hikari.HikariConfig - maxLifetime.....................60000
17:36:50.843 [main] DEBUG com.zaxxer.hikari.HikariConfig - maximumPoolSize.................10
17:36:50.843 [main] DEBUG com.zaxxer.hikari.HikariConfig - metricRegistry..................none
17:36:50.843 [main] DEBUG com.zaxxer.hikari.HikariConfig - metricsTrackerFactory...........none
17:36:50.843 [main] DEBUG com.zaxxer.hikari.HikariConfig - minimumIdle.....................10
17:36:50.843 [main] DEBUG com.zaxxer.hikari.HikariConfig - password........................<masked>
17:36:50.843 [main] DEBUG com.zaxxer.hikari.HikariConfig - poolName........................"HikariPool-1"
17:36:50.843 [main] DEBUG com.zaxxer.hikari.HikariConfig - readOnly........................false
17:36:50.843 [main] DEBUG com.zaxxer.hikari.HikariConfig - registerMbeans..................false
17:36:50.844 [main] DEBUG com.zaxxer.hikari.HikariConfig - scheduledExecutor...............none
17:36:50.844 [main] DEBUG com.zaxxer.hikari.HikariConfig - schema..........................none
17:36:50.844 [main] DEBUG com.zaxxer.hikari.HikariConfig - threadFactory...................internal
17:36:50.844 [main] DEBUG com.zaxxer.hikari.HikariConfig - transactionIsolation............default
17:36:50.844 [main] DEBUG com.zaxxer.hikari.HikariConfig - username........................"ykx"
17:36:50.844 [main] DEBUG com.zaxxer.hikari.HikariConfig - validationTimeout...............3000
17:36:50.844 [main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting...
17:36:51.257 [main] DEBUG com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Added connection com.mysql.jdbc.JDBC4Connection@1d77a31d
17:36:51.260 [main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Start completed.
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。