中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

在SpringMVC項目中使用HIkariCP

發布時間:2020-07-15 13:30:08 來源:網絡 閱讀:722 作者:alterem 欄目:編程語言
什么是HIkariCP

https://www.jianshu.com/p/15b846107a7c

使用HikariCP數據源
pom.xml
<dependency>
  <groupId>com.zaxxer</groupId>
  <artifactId>HikariCP</artifactId>
  <version>3.3.1</version>
</dependency>
Spring-mvc.xml
<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.
向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

栖霞市| 名山县| 全州县| 禄劝| 若羌县| 台南市| 麻阳| 邢台市| 克山县| 丰台区| 旬阳县| 广安市| 内乡县| 台湾省| 高邮市| 仁寿县| 锡林郭勒盟| 潼南县| 平泉县| 息烽县| 彰化县| 曲沃县| 建湖县| 昌都县| 运城市| 石城县| 安义县| 合江县| 安丘市| 米林县| 梁河县| 邵阳县| 濮阳市| 巴彦淖尔市| 翼城县| 天水市| 内丘县| 三台县| 永川市| 乌拉特中旗| 迁安市|