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 on page 1.

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:

  • [DomainName] is the fully qualified domain name of the Impala server host.
  • [MappingFile] is the full path to a JSON file that maps your Impala user name to a Kerberos user principal name and a keytab file.
  • [PortNumber] is the number of the TCP port that the Impala server uses to listen for client connections.
  • [Realm] is the Kerberos realm of the Impala server host.
  • [Server] is the IP address or host name of the Impala server to which you are connecting.
  • [ServiceName] is the Kerberos service principal name of the Impala server.
  • [URL] is the partial URL corresponding to the the Impala server.
  • [YourPassword] is the password corresponding to your user name.
  • [YourUserName] is the user name that you use to access the Impala server.

Connecting to an Impala Server Without Authentication

The following is the format of a DSN-less connection string that connects to an Impala server that does not require authentication:

Driver=Simba Impala ODBC Driver;Host=[Server];
Port=[PortNumber];

For example:

Driver=Simba Impala ODBC Driver;Host=192.168.222.160;
Port=21050;

If you are connecting to the server through SSL, then set the SSL property to 1. For example:

Driver=Simba Impala ODBC Driver;Host=192.168.222.160;
Port=21050;SSL=1;

Connecting to an Impala Server that Requires Kerberos Authentication

The following is the format of a DSN-less connection string that connects to an Impala server requiring Kerberos authentication:

Driver=Simba Impala ODBC Driver;Host=[Server];
Port=[PortNumber];AuthMech=Kerberos;KrbRealm=[Realm];
KrbFQDN=[DomainName];KrbServiceName=[ServiceName];

For example:

Driver=Simba Impala ODBC Driver;Host=192.168.222.160;
Port=21050;AuthMech=Kerberos;KrbRealm=SIMBA;
KrbFQDN=localhost.localdomain;KrbServiceName=impala;

If you are connecting to the server through SSL, then set the SSL property to 1. For example:

Driver=Simba Impala ODBC Driver;Host=192.168.222.160;
Port=21050;AuthMech=Kerberos;KrbRealm=SIMBA;
KrbFQDN=localhost.localdomain;KrbServiceName=impala;SSL=1;

Connecting to an Impala Server using Advanced Kerberos Authentication

The following is the format of a DSN-less connection string that connects to an Impala server using Advanced Kerberos authentication:

Driver=Simba Impala ODBC Driver;Host=[Server];
Port=[PortNumber];AuthMech=Kerberos;KrbRealm=[Realm];
KrbFQDN=[DomainName];KrbServiceName=[ServiceName];
UseKeytab=1;UID=[YourUserName];
UPNKeytabMappingFile=[MappingFile];

For example:

Driver=Simba Impala ODBC Driver;Host=192.168.222.160;
Port=21050;AuthMech=Kerberos;KrbRealm=SIMBA;
KrbFQDN=localhost.localdomain;KrbServiceName=impala;
UseKeytab=1;UID=simba;
UPNKeytabMappingFile=C:\Temp\simba.keytab;

If you are connecting to the server through SSL, then set the SSL property to 1. For example:

Driver=Simba Impala ODBC Driver;Host=192.168.222.160;
Port=21050;AuthMech=Kerberos;KrbRealm=SIMBA;
KrbFQDN=localhost.localdomain;KrbServiceName=impala;
UseKeytab=1;UID=simba;
UPNKeytabMappingFile=C:\Temp\simba.keytab;SSL=1;

Connecting to an Impala Server using SAML 2.0

The following is the format of a DSN-less connection string that connects to an Impala server using SAML 2.0 authentication:

Driver=Simba Impala ODBC Driver;Host=[Server];
Port=[PortNumber];AuthMech=SAML_2.0;TransportMode=http;HttpPath=[URL];SSL=1

For example:

Driver=Simba Impala ODBC Driver;Host=192.168.222.160;
Port=21050;AuthMech=SAML_2.0;TransportMode=http;HttpPath=cliservice;SSL=1

Connecting to an Impala Server that Requires User Name Authentication

The following is the format of a DSN-less connection string that connects to an Impala server requiring User Name authentication. By default, the connector uses anonymous as the user name.

Driver=Simba Impala ODBC Driver;Host=[Server];
Port=[PortNumber];AuthMech=SASL User Name;

For example:

Driver=Simba Impala ODBC Driver;Host=192.168.222.160;
Port=21050;AuthMech=SASL User Name;

If you are connecting to the server through SSL, then set the SSL property to 1. For example:

Driver=Simba Impala ODBC Driver;Host=192.168.222.160;
Port=21050;AuthMech=SASL User Name;SSL=1;

Connecting to an Impala Server with LDAP Authentication or other User Name and Password Authentication Enabled

The following is the format of a DSN-less connection string that connects to an Impala server with LDAP authentication, or another form of username/password authentication, enabled:

Driver=Simba Impala ODBC Driver;Host=[Server];
Port=[PortNumber];AuthMech=User Name and Password;UID=[UserName];
PWD=[Password];

For example:

Driver=Simba Impala ODBC Driver;Host=192.168.222.160;
Port=21050;AuthMech=User Name and Password;UID=simba;PWD=simba;

If you are connecting to the LDAP-enabled server through SSL, then set the SSL property to 1. For example:

Driver=Simba Impala ODBC Driver;Host=192.168.222.160;
Port=21050;AuthMech=User Name and Password;UID=simba;PWD=simba;SSL=1;