After one night, I checked n more articles, tried n more complex methods, and finally found a super simple method in an article, it's really just a waste of shoes! You do not need to follow the management method, as long as you follow the methods below, you can successfully configure the Tomcat connection pool.
Set the tomcat/CONF/context. xml file to the following content.
<Context reloadable = "true">
<Watchedresource> WEB-INF/Web. xml </watchedresource>
<Resource Name = "JDBC/MySQL" auth = "Container" type = "javax. SQL. datasource"
Maxactive = "100" maxidle = "30" maxwait = "10000" username = "root" Password = "root" driverclassname = "com. MySQL. JDBC. Driver"
Url = "JDBC: mysql: // localhost: 3306/databasename"/>
</Context>
Or put it under the META-INF of your project. The myslq table and the database driver must be properly placed and connected!