[英]How to validate a Java application with Spring boot 2.x is using Hikari?
We are documenting the technology stack of our applications.我们正在记录我们的应用程序的技术堆栈。 In one application, it connects to an Oracle database and uses Spring Boot 2.3.7 framework.
在一个应用程序中,它连接到 Oracle 数据库并使用 Spring Boot 2.3.7 框架。
I need to definitively determine what connection pool technology it uses to connect to the Oracle database.我需要明确确定它用于连接 Oracle 数据库的连接池技术。 Because Hikari comes with Spring Boot 2.x and the application is auto-configured, there are no references to Hikari.
因为 Hikari 附带 Spring Boot 2.x 并且应用程序是自动配置的,所以没有对 Hikari 的引用。 How can I determine if Hikari is being used?
如何确定是否正在使用 Hikari?
You could try to autowire the Datasource somewhere and then sys out the class name of the Datasource to see what implementation is being used.您可以尝试在某处自动连接数据源,然后系统输出数据源的 class 名称,以查看正在使用的实现。
@Autowired
private DataSource dataSource;
then in a method that will run after Spring initializes然后在 Spring 初始化后运行的方法中
System.out.println("DataSource : " + dataSource.getClass().toString());
A simple approach, reduce logging level of Hikari, it's quite verbose on DEBUG level and gives you information about configuration, number of connections and their statuses:一种简单的方法,降低 Hikari 的日志记录级别,它在 DEBUG 级别非常详细,并为您提供有关配置、连接数及其状态的信息:
logging.level.com.zaxxer.hikari.HikariConfig=DEBUG
logging.level.com.zaxxer.hikari=DEBUG
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.