Tomcat configures sqlserver connection pool
1. Go to the conf folder directory under the Tomcat directory and find server. xml
In the Tomcat server. xml file, set the connection statement in the </context> label and <! -Path indicates the directory of your application./dbtest indicates that the path is in the Tomcat webapps directory.
<! -Docbase = "dbtest" indicates the path name when you stop the program. For example, the following execution path is http: // localhost: 8080/dbtest -->
<Context Path = "/dbtest" docbase = "dbtest"
DEBUG = "5" reloadable = "true" crosscontext = "true">
<! -- Maxactive: the maximum number of connection pools. Make sure there are sufficient connections. -->
<! -- Maxidle: the maximum number of idle connections. If it is set to-1, it indicates no limit. -->
<! -- Maxwait: The maximum waiting time (the maximum waiting time for the reverse connection pool to be available), in the unit of nanoseconds, that is, set to 10000 equal to 10 seconds. If it is set to-1, it indicates uncertainty -->
<! -- Username and password: account and password used to connect to the database -->
<! -- Driverclassname: The driver used to connect to the database. For example, sqlserver is
Com. Microsoft. JDBC. sqlserver. sqlserverdriver. -->
<! -- URL: The Path to the database, as shown in figure
JDBC: Microsoft: sqlserver: // localhost: 1433; databasename = kb_rate -->
<Resource Name = "default_jdbc" auth = "Container" type = "javax. SQL. datasource"
Maxactive = "100" maxidle = "30" maxwait = "10000"
Username = "javauser" Password = "javadude"
Driverclassname = "com. Microsoft. JDBC. sqlserver. sqlserverdriver"
Url = "JDBC: Microsoft: sqlserver: // localhost: 1433; databasename = kb_rate" "/>
</Context>