Installing Postgres JDBC Driver
You must install the required Postgres JDBC driver.
Download, extract, and copy the JDBC driver, renamed, to /usr/share/java/. If the target directory does not yet exist, create it.
Installing the Postgres JDBC Driver
- Install the PostgreSQL JDBC driver by running the following
command:
wget https://jdbc.postgresql.org/download/postgresql-42.<version>.jar
- Alternatively, if you would like to use the PostgreSQL
JDBC driver version shipped with the OS
repositories, run the following commands with a
driver version that is compatible with the
PostgreSQL Server version:
- RHEL
-
sudo yum install postgresql-jdbc<compatible_version>
- Ubuntu
-
sudo apt-get install libpostgresql-jdbc-java<compatible_version>
- SLES
-
sudo zypper install postgresql-jdbc<compatible_version>
- Rename the Postgres JDBC driver
.jar
file topostgresql-connector-java.jar
and copy it to the/usr/share/java
directory. The following copy command can be used if the Postgres JDBC driver.jar
file is installed from the OS repositories:cp /usr/share/java/postgresql-jdbc.jar /usr/share/java/postgresql-connector-java.jar
- Confirm that the .jar file is in the Java share directory:
ls /usr/share/java/
- Change the access mode of the .jar file to 644:
chmod 644 /usr/share/java/postgresql-connector-java.jar