This topic provides a configuration example of a Tomcat connection pool.
Modify the configuration file
Modify the configuration file of a Tomcat connection pool.
<Resource name="jdbc"
auth="Container"
type="javax.sql.DataSource"
maxActive="100" // The maximum number of connections that a database can have on the server.
maxIdle="30" // The minimum number of connections that a database maintains on the server.
maxWait="10000" // The maximum wait time. 10000 ms
username="root"
password="******"
driverClassName="com.mysql.cj.jdbc.Driver"
url="jdbc:mysql://10.100.xxx.xxx:18815/test?characterEncoding=UTF-8"/>
Configure the project
After you modify the configuration file, configure the web.xml file of the project as follows:
<resource-ref>
<res-ref-name>jdbc</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>