Making a connection from your code

Sample connection scripts for connecting to your PostgreSQL database are provided for PHP, Perl and Java.

In all cases your connection script needs to specify four variables:

  1. Host (always set to localhost)
  2. Username
  3. Database name
  4. Password

Code specific examples