JDBC PostgreSQL Connection

In this tutorial we will connect a Java application to a PostgreSQL database using JDBC. 1. Prerequisites Eclipse JDBC PostgreSQL driver (https://jdbc.postgresql.org/download.html) Running PostgreSQL database 2. Create standard Java project In Eclipse, create a new Java project Create a folder called “lib” in the root folder of the project Copy the JDBC driver into that “lib” folder Right click the JDBC jar file and select Build Path ⇒ Add to Build Path 3. JDBC PostgreSQL connection example At first we need a wrapper class to connect to a selected database. Do not forget to adapt your…

Read More