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
DSN Connection String Example
To write a connection string that uses a DSN, set the DSN
key to the name of your DSN. As an alternative, you can set the DataSourceName
key, which is synonymous with the DSN
key.
The following are examples of connection strings that use a DSN:
DSN=MyDSNForTeradata
DataSourceName=MyDSNForTeradata
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, in alphabetical order:
- [AuthenticationMechanism] is the mechanism that the connector uses to authenticate the connection to the database. For information about the supported settings, see Mechanism.
- [JWT_Token] is the JSON web token that you obtained from the UDA User Service.
- [Server] is the IP address or host name of the Teradata Database instance to which you are connecting.
- [YourUserName] is the user name that you use to access the database.
- [YourPassword] is the password corresponding to your user name.
Connecting to a Teradata Database Instance Using Single Sign-On
The following is the format of a DSN-less connection string that connects to the database using Single Sign-On (SSO):
Driver=Simba Teradata ODBC Connector;DBCName=[Server];MechanismName=[AuthenticationMechanism];UseIntegratedSecurity=1;
Note:
MechanismName
is optional. If this option is not set, then the connector uses the authentication mechanism that the TeraGSS program specifies in the tdgssconfigure.xml
file.
For example:
Driver=Simba Teradata ODBC Connector;DBCName=192.168.222.160;MechanismName=TD2;UseIntegratedSecurity=1;
Connecting to a Teradata Database Instance Using TD2
The following is the format of a DSN-less connection string that connects to the database using the TD2 protocol:
Driver=Simba Teradata ODBC Connector;DBCName=[Server];MechanismName=TD2;UID=[YourUserName];Password=[YourPassword];
For example:
Driver=Simba Teradata ODBC Connector;DBCName=192.168.222.160;MechanismName=TD2;
UID=jsmith;Password=simba123;
Alternatively, you can provide a Teradata Wallet reference string instead of a password. For example:
Driver=Simba Teradata ODBC Connector;DBCName=192.168.222.160;MechanismName=TD2;
UID=jsmith;WalletString=$tdwallet(jsmith_wallet_string);EnableWallet=1;
Note:
The Teradata Wallet utility must be installed and configured before you can connect using a reference string.
Connecting to a Teradata Database Instance Using LDAP, Kerberos, or TDNEGO
The following is the format of a DSN-less connection string that connects to the database using the LDAP, Kerberos, or TDNEGO protocol. For LDAP and Kerberos, you do not need to set the UID
and Password
properties, because the connector obtains these credentials from the application. For TDNEGO, depending on the actual mechanism that the connector selects as a result of the negotiation process, you might need to set UID
and Password
as shown in the example above for TD2.
Driver=Simba Teradata ODBC Connector;DBCName=[Server];MechanismName=[AuthenticationMechanism];
For example, to use LDAP:
Driver=Simba Teradata ODBC Connector;DBCName=192.168.222.160;MechanismName=LDAP;
Connecting to a Teradata Database Instance Using a JSON Web Token
The following is the format of a DSN-less connection string that connects to the database using a JSON web token (JWT):
Driver=Simba Teradata ODBC Connector;DBCName=[Server];MechanismName=JWT;AuthenticationParameter={token=[JWT_Token]};
For example:
Driver=Simba Teradata ODBC Driver;DBCName=192.168.222.160;MechanismName=JWT;
AuthenticationParameter={token=zio5YOBZ.nExFB6lm.SOwvlWy2};
- Driver Configuration Options on page 1
- Creating a Data Source Name
- Creating a Data Source Name
- Configuring a DSN-less Connection
- Configuring the Driver on page 1