Connection string examples
- Last Updated: April 24, 2024
- 2 minute read
- DataDirect Connectors
- ODBC
- Greenplum 8.0
- Documentation
ODBC provides a method for specifying connection information via a connection string and the SQLDriverConnect API. This section provides examples of connection strings configured to use common features and functionality. You can modify and/or combine these examples to create a connection string for your environment.
In addition to the connection strings for DSN-less connections demonstrated in this section, the driver supports DSN and File DSN connection strings. See "Using a connection string" for syntax and detailed information for supported connection string types.
- User ID and password authentication
- Kerberos authentication
- Connection failover
- TLS/SSL client authentication
- TLS/SSL server authentication
- Proxy server authentication
User ID and password authentication
This string includes the options used to connect using user ID and password authentication.
DRIVER=DataDirect 8.0 Greenplum Wire Protocol;HostName=MyServer;
PortNumber=5432;Database=Payroll;LogonID=jsmith;Password=secret;
For more information on these options and values, see User ID/password authentication.
Kerberos authentication
This string includes the options used to connect using Kerberos authentication.
DRIVER=DataDirect 8.0 Greenplum Wire Protocol;AuthenticationMethod=4;
HostName=MyServer;PortNumber=5432;Database=Payroll;GSSClient=gss123;
ServicePrincipalName=postgres/myserver.example.com@EXAMPLE.COM;
LogonID=John;
For more information on these options and values, see Kerberos authentication.
Connection failover
This string includes the options used to connect using connection failover.DRIVER=DataDirect 8.0 Greenplum Wire Protocol;HostName=MyServer;PortNumber=5432;
Database=Payroll;AlternateServers=(HostName=MyBackupServer:PortNumber=5432:
Database=Accounting,HostName=255.201.11.24:PortNumber=5431:Database=Accounting);
ConnectionRetryCount=4;ConnectionRetryDelay=5;LoadBalancing=1;FailoverMode=0;
LogonID=jsmith;Password=secret; For more information on these options and values,
see Failover support.TLS/SSL client authentication
This string configures
driver to establish a connection using user ID/password authentication and encrypt data
using TLS/SSL client authentication. In this configuration, since
ValidateServerCertificate=1, the driver validates the certificate sent by
the server and the host name specified by
HostNameInCertificate.
DRIVER=DataDirect 8.0 Greenplum Wire Protocol;EncryptionMethod=1;
HostName=YourServer;HostNameInCertificate=MySubjectAltName;
PortNumber=5432;Database=PAYROLL;Keystore=KeyStoreName;
KeystorePassword=YourKSPassword;ValidateServerCertificate=1;
LogonID=jsmith;Password=secret; For more information on these options and values,
see TLS/SSL client authentication.TLS/SSL server authentication
This string configures the
driver to establish a connection using user ID/password authentication and encrypt data
using TLS/SSL server authentication. In this configuration, since
ValidateServerCertificate=1, the driver validates the certificate sent by
the server and the host name specified by
HostNameInCertificate.
DRIVER=DataDirect 8.0 Greenplum Wire Protocol;EncryptionMethod=1;HostName=MyServer;
HostNameInCertificate=MySubjectAltName;PortNumber=5432;Database=PAYROLL;
Truststore=TrustStoreFile;TruststorePassword=TSXYZZY;ValidateServerCertificate=1;
LogonID=jsmith;Password=secret; For more information on these options and values,
see TLS/SSL server authentication.Proxy server authentication
This string includes the options required for using a proxy server with the user ID/password authentication.
DRIVER=DataDirect 8.0 Greenplum Wire Protocol;HostName=MyServer;
ProxyHost=pserver;ProxyPassword=proxys3cr3t;ProxyPort=1234;
ProxyUser=jsmith;LogonID=jsmith@abc.com;Password=secret;
For more information on these options and values, see Proxy server support.