HIKARICP claims to be the fastest, today to change over to try
1. Modify the configuration file
- <!--Hikari Datasource--
- <Bean id= "dataSource" class="Com.zaxxer.hikari.HikariDataSource" destroy-method= "Shutdown">
- <property name= "driverclassname" value="${jdbc.driver}" /> <!--No need to specify, Unless the system does not automatically identify
- <property name="Jdbcurl" value="${jdbc.url}" />
- <property name="username" value="${jdbc.username}" />
- <property name="password" value="${jdbc.password}" />
- <!--configured to True when connecting to a read-only database, guaranteed security -
- <property name="readOnly" value= "false" />
- <!--The maximum length of time (in milliseconds) to wait for a connection pool to allocate a connection, a connection that exceeds the length of time that is not available SqlException, default: 30 Seconds--
- <property name= "connectiontimeout" value="30000" />
- <!--The maximum length of time (in milliseconds) for a connected idle state, and the timeout is released (retired), default: 10 minutes --
- <property name= "idleTimeout" value="600000" />
- <!--The lifetime of a connection (milliseconds), timed out and not being used is released (retired), default: 30 minutes, recommended setting is 30 seconds less than database timeout, refer to mysql wait_timeout parameter (show variables Like '%timeout% ';) --
- <property name= "maxlifetime" value="1800000" />
- <!--The maximum number of connections allowed in the connection pool. Default value: 10; Recommended formula: ((Core_count * 2) + effective_spindle_count)- -
- <property name= "maximumpoolsize" value= " /> "
- </Bean>
2. Load the jar package
- <dependency>
- <groupId>com.zaxxer</groupId>
- <artifactid>hikaricp</artifactid>
- <version>2.4.6</version>
- <scope>compile</scope>
- </Dependency>
This is the end, but after the start error, and no connection on
3. Replace the Oracle package (the database is using Oracle)
- <dependency>
- <groupId>com.oracle</groupId>
- <artifactid>ojdbc6</artifactid>
- <version>${oracle.driver.version}</version>
- <scope>runtime</scope>
- </Dependency>
- <oracle.driver.version>11.2.0.3</oracle.driver.version>
Used to be oracle14, use the Times wrong link is not on.
Convert database connection pool to HIKARICP