Another Update:
The distro vendors tend to break up packages like tomcat to consolidate shared dependencies between the various packages in their lineup. That's the case with tomcat 7 as well.
To illustrate:
# apt install -y tomcat7
The following NEW packages will be installed:
[...]
libcommons-collections3-java libcommons-dbcp-java libcommons-pool-java
[...]
tomcat7-common
[...]
After installing, check out the package contents:
# dpkg -L tomcat7-common | grep dbcp
/usr/share/tomcat7/lib/commons-dbcp.jar
# ls -lhA /usr/share/tomcat7/lib/commons-dbcp.jar
lrwxrwxrwx 1 root root 27 Oct 10 2018 /usr/share/tomcat7/lib/commons-dbcp.jar -> ../../java/commons-dbcp.jar
# grep lib /etc/tomcat7/catalina.properties
common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar,${catalina.home}/common/classes,${catalina.home}/common/*.jar
catalina.properties
controls how Tomcat's classpath should be setup when starting the server.
Update:
Quoting the docs:
The default database connection pool implementation in Apache Tomcat
relies on the libraries from the Apache Commons project. The following
libraries are used:
Commons DBCP 1.x
Commons Pool 1.x
These libraries are located in a single JAR at
$CATALINA_HOME/lib/tomcat-dbcp.jar
. However, only the classes needed
for connection pooling have been included, and the packages have been
renamed to avoid interfering with applications.
Still, I strongly recommend reading the intro to Java (EE) web applications listed below. If you use Java servlet containers these principles still hold, especially in the enterprise world.
For a more modern take on Java in the container world I recommend Cloud Native Java, but beware, the authors have swallowed the cloud gospel hook, line and sinker :-)
Original response:
Please clarify, are you talking about:
- Which of the connections set up in Tomcat's configs is used by the app?
- Where the DB connection defined and used is magically coming from?
- Which connection pool implementation is in use?
What might be helpful is what is in the config files you mention that differs from what the OS vendor (Debian) put in them.
A broad tip I can give you is to familiarize yourself with the way deployment descriptors in Java (EE) Webapps work and how vendor-specific extensions are used.