Enter the Tomcat's Admin management interface, click DataSource to configure your parameters, the configured parameters are as follows (JDBC drivers to jtds): JNDI Name: JDBC / MySQLData Source URL: JDBC: JTDS: SQLServer: // localhost: 1433 / testjdbc Driver Class: net.sourceforge.jtds.jdbc.DriverUser Name: testPassword: testMax Active Connections:. 4Max Idle Connections:. 2Max Wait for Connection:. 5000Validation Query: // without adding in% TOMCAT_HOME% / conf / Catalina / localhost under Find your web application corresponding to the .xml file, such as Test.xml, and add the code under this file: