The solution to the problem that the method of interacting with database in the servlet class is invalid after the servlet submits 404, 500 refresh and becomes 404, and after connecting to the data pool

About 404

When checking the path and web inf carefully, take a look at the default path of Tomcat and change it to

About 505 in refresh to 404

There may be a problem with the jar package. It is recommended to check it carefully and try importing it again

Method failure
was found         The connection pool needs to use streams to accept configuration files. I wrote classloder.getsystemclassloder, which is wrong. It should be written as jdbcutils. Class. Getclassloder
instead           Classloader.getsystemclassloader is a system class loader (or application class loader), but in Tomcat’s class loader architecture, or ordinary web projects (JavaEE projects, not ordinary Java projects), we write our own business program code and resource files (configuration files are also counted, the code is the code in the SRC directory), When you deploy to the server, you will go to/WEB-INF/classes and/web-infb (you can go and have a look). The contents in these two directories are not loaded by the system class loader, but a webappclassloader (which can be printed)   System.out.println(JdbcUtils.class.getClassLoader());), So you can’t

use that  

Read More: