Download jdbc driver from the postgresql website
import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class JDBCExample { public static void main(String[] args) { // https://docs.oracle.com/javase/8/docs/api/java/sql/package-summary.html#package… The class simply provides a series of methods for retrieving columns from the results of a database query ResultSet class handles only a single row from the database at any given time.