One way to connect to a service is through the JDBC DriverManager using the DriverManager.getConnection() method. As the following examples show, this method specifies a string containing a connection URL.

User ID/password authentication

Connection conn = DriverManager.getConnection
  ("jdbc:datadirect:greenplum://server1:5432;
    AuthenticationMethod=userIdPassword;User=test;
    Password=secret;");

Kerberos authentication

Connection conn = DriverManager.getConnection
  ("jdbc:datadirect:greenplum://server1:5432;
    DatabaseName=greenplumDB;AuthenticationMethod=kerberos;
    ServicePrincipalName=postgres/myserver.example.com@EXAMPLE.COM;");