Example of configuring a Tomcat connection pool

2023-07-24 09:52:12  Updated

This topic describes the configuration files of a Tomcat connection pool.

Configuration file

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.oceanbase.jdbc.Driver"
url="jdbc:oceanbase://10.100.xxx.xxx:18815/test?characterEncoding=UTF-8"

Configure the web.xml file of the project.

<resource-ref>
         <res-ref-name>jdbc</res-ref-name>
         <res-type>javax.sql.DataSource</res-type>
         <res-auth>Container</res-auth>
</resource-ref>

Contact Us