This is the simplest way to connect.
First, the driver has to be registered with java.sql.DriverManager so that it knows which class to use.
This is done by loading the driver class, typically with java.lang.Class.forname(<driver class name>).
/**
* Connect to a PostgreSQL database.
*...