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 Connector Configuration Options.

Note: If the server does not support HTTPS connections or SSL verification, then you must disable those features by setting additional properties in your connection string. For more information, see .

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:

  • [YourAccessToken] is your access token for GitHub.
  • [YourInstanceUrl] is the IP address or host name of the GitHub server.
  • [YourPath] is the full path of the .pem file containing trusted CA certificates for verifying the server during SSL authentication.
  • [YourRedirectUri] is base redirect URI for OAuth 2.0 authentication.
  • [YourUserAgent] is the GitHub username, or the name of your application.

Connecting to GitHub Using Access Token

You can connect to the data source using an access token through either SQLBrowseConnect or SQLDriverConnect. The following is the format of a DSN-less connection string for connecting to GitHub using access token authentication:

Driver=Simba GitHub ODBC Driver;Host=[YourInstanceUrl];Auth_Type=Access Token;User_Agent=[YourUserAgent];Auth_AccessToken=[YourAccessToken];

For example:

Driver=Simba GitHub ODBC Driver;Host=api.github.com;Auth_Type=Access Token;User Agent=user-name-or-app-name;Auth_AccessToken=ghp_jhdjuch89e89390nvknfvskvwHxuo;

Connecting to GitHub Using Your GitHub Credentials

You can connect to the data source using your GitHub credentials through only SQLBrowseConnect. The following is the format of a DSN-less connection string for connecting to GitHub using your GitHub app information. The connector initiates an OAuth 2.0 authentication flow based on your app information and then uses the retrieved access token to authenticate the connection.

Driver=Simba GitHub ODBC Driver;Host=[YourInstanceURL];Auth_Type=OAuth_2.0;Auth_Client_ID=[YourClientID];Auth_Client_Secret=[YourClientSecret];Auth_BaseRedirectURI=[YourRedirectURI];User_Agent=[YourUserAgent];Auth_AccessToken=[YourAccessToken];

For example:

Driver=Simba GitHub ODBC Driver;Host=api.github.com;Auth_Type=OAuth_2.0;Auth_Client_ID=jazncxoiwec;Auth_Client_Secret=123456;Auth_BaseRedirectURI=http://localhost:6367/;User Agent=user-name-or-app-name;Auth_AccessToken=ghp_HvD3wAdummytoken5882hd83hdHxuo;

Connecting to GitHub Using Windows Trust Store

The following is the format of a DSN-less connection string for connecting to the GitHub server that requires SSL and uses the Windows trust store:

Driver=SimbaGitHub ODBC Driver;Host=[YourInstanceUrl];Auth_Type=Access Token;Auth_AccessToken=[YourAccessToken];User Agent=[YourUserAgent];SystemTrustStore=1;

For example:

Driver=SimbaGitHub ODBC Driver;Host=api.github.com;Auth_Type=OAuth_2.0;Auth_AccessToken=ghp_HvD3wAdummytoken5882hd83hdHxuo;User Agent=john-doe-app;SystemTrustStore=1;

The following is the format of a DSN-less connection string for connecting to the GitHub server that requires SSL and uses the path provided in the TrustCertsPath property:

Driver=SimbaGitHub ODBC Driver;Host=[YourInstanceUrl];Auth_Type=Access Token;Auth_AccessToken=[YourAccessToken];User Agent=[YourUserAgent];SystemTrustStore=0;TrustCertsPath=[YourPath];

For example:

Driver=SimbaGitHub ODBC Driver;Host=api.github.com;Auth_Type=OAuth_2.0;Auth_AccessToken=ghp_HvD3wAdummytoken5882hd83hdHxuo;SystemTrustStore=0;User Agent=john-doe-app;TrustCertsPath=C:\Users\JSmith\Desktop\Cert\GitHub.pem;