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,
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, in alphabetical order:
- [AuthType] is the method that is used for authentication.
- [PortNumber] is the number of the port that the Presto server uses to listen for client connections.
- [Server] is the IP address or host name of the Presto server to which you are connecting.
- [YourAccessToken] is the access token that you use to access the Presto server.
- [YourUserName] is the user name that you use to access the Presto server.
The following is the format of a DSN-less connection string:
Driver=Simba Presto ODBC Driver;
Host=[Server];Port=[PortNumber];AuthMech=[Auth_Type];
For example:
Driver=Simba Presto ODBC Driver;
Host=http://host%3Dorg.api.imply.io/;Port=443;AuthMech=0
Connecting to Presto Using Basic Authentication
The following is the format of a DSN-less connection string for connecting to Presto using basic authentication:
Driver=SimbaPresto ODBC Driver;Host=[YourInstanceURL];Auth_Type=Basic;UID=[YourAPIKey]
For example:
Driver=SimbaPresto ODBC Driver;Host=https://api.stripe.com;Auth_Type=Basic;UID=sk_test_cXg9KLwthuyyu980694
Connecting to Trino Using Basic Auth (API Key authentication)
You can connect to the Trino server by using API Key authentication. The following is the format of a DSN-less connection string for connecting to Trino usingAPI Key authentication:
Driver= Simba Trino ODBC Driver;
Host=[Server];Port=[PortNumber];AuthMech=[Auth_Type];UID=[Your_API_Key];PWD=[YourPassword]
For example:
Driver= Simba Trino ODBC Driver;
Host=http://host%3Dorg.api.imply.io/;Port=443;AuthMech=0;UID=some_API_Key;