How To Install apache-commons-dbcp on CentOS 7
Introduction
In this tutorial we learn how to install apache-commons-dbcp
on CentOS 7.
What is apache-commons-dbcp
Many Apache projects support interaction with a relational database. Creating a new connection for each user can be time consuming (often requiring multiple seconds of clock time), in order to perform a database transaction that might take milliseconds. Opening a connection per user can be unfeasible in a publicly-hosted Internet application where the number of simultaneous users can be very large. Accordingly, developers often wish to share a “pool” of open connections between all of the application’s current users. The number of users actually performing a request at any given time is usually a very small percentage of the total number of active users, and during request processing is the only time that a database connection is required. The application itself logs into the DBMS, and handles any user account issues internally.
We can use yum
or dnf
to install apache-commons-dbcp
on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install apache-commons-dbcp.
Install apache-commons-dbcp on CentOS 7 Using yum
Update yum database with yum
using the following command.
sudo yum makecache
After updating yum database, We can install apache-commons-dbcp
using yum
by running the following command:
sudo yum -y install apache-commons-dbcp
Install apache-commons-dbcp on CentOS 7 Using dnf
If you don’t have dnf installed you can install DNF on CentOS 7 first.
Update yum database with dnf
using the following command.
sudo dnf makecache
After updating yum database, We can install apache-commons-dbcp
using dnf
by running the following command:
sudo dnf -y install apache-commons-dbcp
How To Uninstall apache-commons-dbcp on CentOS 7
To uninstall only the apache-commons-dbcp
package we can use the following command:
sudo dnf remove apache-commons-dbcp
References
Summary
In this tutorial we learn how to install apache-commons-dbcp
on CentOS 7 using yum
and dnf
.