Using a Connection String

For some applications, you might need to use a connection string to connect to your data source. For detailed information about how to use a connection string in an ODBC application, refer to the documentation for the application that you are using.

The connection strings in the following sections are examples showing the minimum set of connection attributes that you must specify to successfully connect to the data source. Depending on the configuration of the data source and the type of connection you are working with, you might need to specify additional connection attributes. For detailed information about all the attributes that you can use in the connection string, see Driver Configuration Options.

DSN Connection String Example

The following is an example of a connection string for a connection that uses a DSN:

DSN=[DataSourceName]

[DataSourceName] is the DSN that you are using for the connection.

You can set additional configuration options by appending key-value pairs to the connection string. Configuration options that are passed in using a connection string take precedence over configuration options that are set in the DSN.

DSN-less Connection String Examples

Some applications provide support for connecting to a data source using a connector without a DSN. To connect to a data source without using a DSN, use a connection string instead.

The placeholders in the examples are defined as follows:

  • [CertFile] is the full path to the PEM certificate used by the server.
  • [DatabaseName] is the name of the database that you want to access.
  • [PortNumber] is the port that you use to access the server.
  • [SecLevel] is the level of SSL/TLS security required by the connector. For example, PreferredSecured.
  • [ServerName] is the name or IP address of the server that you want to access.
  • [YourPassword] is the password corresponding to your user name.
  • [YourUserName] is the user name that you use to access the Netezza server.

Connecting to Netezza Using Your Netezza Database Credentials

The following is the format of a DSN-less connection string that connects to a Netezza server using your database credentials:

Driver=Simba Netezza ODBC Driver;Server=[ServerName];Port=[PortNumber];Database=[DatabaseName];UID=[YourUserName];PWD=[YourPassword]

For example:

Driver=Simba Netezza ODBC Driver;Server=192.168.222.160;
Port=5480;Database=Local;UID=jsmith;PWD=simba123

Connecting to Netezza Using Kerberos

The following is the format of a DSN-less connection string for connecting to Netezza using the Kerberos protocol:

Driver=Simba Netezza ODBC Driver;Server=[ServerName];Port=[PortNumber];Database=[DatabaseName];UID=[YourUserName]

For example:

Driver=Simba Netezza ODBC Driver;Server=192.168.222.160;
Port=5480;Database=Local;UID=jsmith

Connecting to Netezza Using SSL

The following is the format of a DSN-less connection string for connecting to Netezza and encrypting the connection using SSL. In this example, the connector authenticates the connection using Netezza database credentials; however, you can configure the connector to authenticate through Kerberos instead, as shown in the example above.

Driver=Simba Netezza ODBC Driver;Server=[ServerName];Port=[PortNumber];Database=[DatabaseName];UID=[YourUserName];PWD=[YourPassword];SecurityLevel=[SecLevel];CaCertFile=[CertFile]

For example:

Driver=Simba Netezza ODBC Driver;Server=192.168.222.160;
Port=5480;Database=Local;UID=jsmith;PWD=simba123;
SecurityLevel=PreferredSecured;CaCertFile=/nz/ca.pem