Using Java spring 2.5 (Tomcat container) and HikariCP and connection pooling system, How can I know at each moment how many Java threads are working and each thread has how many database connection ? And if possible I would like to have log for each thread and database connection separately. Like seeing for example thread A at the moment has 3 open connections to the database and these are queries being executed from each of those connections.

