Druid
Druid 是阿里巴巴开源平台上一个数据库连接池实现,结合了 C3P0、DBCP 等 DB 池的优点,同时加入了日志监控。
这个也没什么好说的,都是死操作,直接看别人写的
https://blog.youkuaiyun.com/qq_33369905/article/details/106647302?spm=1001.2014.3001.5501
不过有一点,就是Springboot内置了Servlet容器时没有web.xml文件,所以使用 Spring Boot 的注册 Servlet 方式
ServletRegistrationBean<StatViewServlet> bean = new ServletRegistrationBean<>(new StatViewServlet(), "/druid/*");
包括过滤器也是一样的
FilterRegistrationBean bean = new FilterRegistrationBean();
然后记得@Bean