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:
- [MapFile] is the full path of a JSON file that maps a Kerberos principal name and a keytab file to a user name.
- [PortNumber] is the number of the TCP port that the HBase server uses to listen for client connections.
- [Server] is the IP address or host name of the HBase server to which you are connecting.
- [YourPassword] is the password corresponding to your user name.
- [YourUserName] is the user name that you use to access the HBase server.
Connecting to an HBase Server Without Authentication
The following is the format of a DSN-less connection string for an HBase server that does not require authentication:
Driver=Simba HBase ODBC Driver;Host=[Server];
Port=[PortNumber];
For example:
Driver=Simba HBase ODBC Driver;Host=192.168.222.160;
Port=9090;
Connecting to an HBase Server Requiring Basic Authentication
The following is the format of a DSN-less connection string for an HBase server that requires basic authentication:
Driver=Simba HBase ODBC Driver;Host=[Server];
Port=[PortNumber];AuthType=1;UID=[YourUserName];
PWD=[YourPassword];
For example:
Driver=Simba HBase ODBC Driver;Host=192.168.222.160;
Port=9090;AuthType=1;UID=simba;PWD=simba123;
Connecting to an HBase Server Requiring Basic Kerberos Authentication
The following is the format of a DSN-less connection string for an HBase server that requires Basic Kerberos authentication. Basic Kerberos authentication is available only for non-Windows versions of the connector, and in addition to configuring settings for the connection, you must also use Kerberos to generate a ticket for your principal.
Driver=Simba HBase ODBC Driver;Host=[Server];
Port=[PortNumber];AuthType=2;
For example:
Driver=Simba HBase ODBC Driver;Host=192.168.222.160;
Port=9090;AuthType=2;
Connecting to an HBase Server Requiring Advanced Kerberos Authentication
The following is the format of a DSN-less connection string for an HBase server that requires Advanced Kerberos authentication. Advanced Kerberos authentication is available only for non-Windows versions of the connector. By default, the connector uses the UID
value as the principal and uses the system-wide default keytab file.
Driver=Simba HBase ODBC Driver;Host=[Server];
Port=[PortNumber];AuthType=3;UID=[YourUserName];
For example:
Driver=Simba HBase ODBC Driver;Host=192.168.222.160;
Port=9090;AuthType=3;UID=simba;
Alternatively, you can use a JSON file to map the UID
to a specific principal and keytab file. The following is an example of a mapping in a JSON file:
{
"simba": {
"principal" : "simba@EXAMPLE.COM",
"keytabfile": "/tmp/simba.keytab"
}
}
The following is the format of a DSN-less connection string that specifies a mapping file:
Driver=Simba HBase ODBC Driver;Host=[Server];
Port=[PortNumber];AuthType=3;UID=[YourUserName];
UserMappingFile=[MapFile];
For example:
Driver=Simba HBase ODBC Driver;Host=192.168.222.160;
Port=9090;AuthType=3;UID=simba;UserMappingFile=C:\mapping.json;
- 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