MySql jdbc URL parameter description

In the case of using database connection pool, it is best to set the following two parameters:
autoReconnect=true&failOverReadOnly=false


Reference: https://www.oschina.net/question/16_2400

     http://java12345678.iteye.com/blog/2265639

     http://dev.mysql.com/doc/connector-j/5.1/en/connector-j-reference-configuration-properties.html


mysql bug URL:
http://bugs.mysql.com/bug.php?id =75440


The jdbc connection pool in
Tomcat Tomcat is not only a very popular Servlet container, but also provides us with many very useful components. jdbc pool is one of the most practical and efficient implementations of jdbc connection pools.
Tomcat officially lists 15 advantages of tomcat over other connection pools:
http://tomcat.apache.org/tomcat-8.0-doc/jdbc -pool.html#Additional_features'

jdbc pool component exists in the lib/tomcat-jdbc.jar package of the tomcat8 release version .


All the classes we use exist in org.apache.tomcat.jdbc.pool under the package name.

Dependency

Here we use mysql as the database to demonstrate
adding mysql-connector dependencies

<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>5.1.34</version>
</dependency>

Of course, our tomcat-jdbc is also indispensable
<dependency>
    <groupId>org.apache.tomcat</groupId>
    <artifactId>tomcat-jdbc</artifactId>
    <version>8.0.15</version>
</dependency>


It should be noted that tomcat-jdbc depends on the tomcat-juli package, which is the logging framework in tomcat. Depended by almost all tomcat packages. If you use maven to install dependencies, don't bother, because it will be installed automatically. If you download the jar package separately, you still need to download the jar package to CLASS_PATH .

https://segmentfault.com/a/1190000002504983

Its English documentation is at http://tomcat.apache.org/tomcat-8.0-doc/jdbc-pool.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326486768&siteId=291194637
Recommended