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

  1. Install the PostgreSQL JDBC driver. If you would like to use the PostgreSQL JDBC driver version shipped with the OS repositories, run the following command:
    yum install postgresql-jdbc*

    You can also download the JDBC driver from the official PostgreSQL JDBC Driver website – https://jdbc.postgresql.org.

  2. Rename the Postgres JDBC driver .jar file to postgresql-connector-java.jarand 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
  3. Confirm that the .jar file is in the Java share directory:
    ls /usr/share/java/postgresql-connector-java.jar
  4. Change the access mode of the .jar file to 644:
    chmod 644 /usr/share/java/postgresql-connector-java.jar