Using configurations for setting connection pool also allows for server or web application specific connection pool tuning to meet demands of the application(s) on that particular server. It also abstracts away database connection related plumbing, and allows developers to focus on business logic.
#Apache tomcat 7.0.59 driver
Use of JDBC API allows for flexibility of changing data source implementation driver form MySQL to Oracle for example, and allows using improved data source specific connection pool implementations. It has many benefits one of which is increased performance and reduced connection creation and removal overhead due to connection reuse by the connection pool. Connection pooling has many benefits and is part of the Java EE standard implemented by Tomcat. The connection to the data source, such as database is attempted when ‘s getConnection() method is called.
![apache tomcat 7.0.59 apache tomcat 7.0.59](https://www.itlearn360.com/wp-content/uploads/2018/01/apache_tomcat-card-min.png)
A DataSource object is looked up in the context based on registered through JNDI Resource. A data source driver allows accessed to the database via DataSource interface. interface is registered with the naming service based on JNDI API. is a factory for getting connections to different physical data sources. In this example we will discuss setting a global DataSource for MySQL database. The connection pool we will look at is, which is a JDBC API for getting a connection instance to a database.
![apache tomcat 7.0.59 apache tomcat 7.0.59](https://operavps.com/wp-content/uploads/2020/05/Install-Tomcat.png)
In this example we will discuss Apache Tomcat Servlet/JSP container’s connection pull configuration via JNDI (Java Naming and Directory Interface ) resources.