Testing the ODBC Connection
The procedure for testing the ODBC connection differs depending on your platform, as described in the following sections:
- Testing the ODBC Connection on Linux
- Testing the ODBC Connection on Mac OS X
- Testing the ODBC Connection on Windows
Testing the ODBC Connection on Linux
To test the ODBC connection on Linux use the test utilities in the
samples directory of the driver manager installation:
test how your driver works with an ANSI application. Use
iodbctestw to test
how your driver works with a Unicode application.
There are 32-bit and 64-bit installations of the iODBC driver manager available. If you have only one or the other installed, then the appropriate version of iodbctest (or iodbctestw) is available. However, if you have both 32- and 64-bit versions installed, then you need to be careful that you are running the version from the correct installation directory.
Visit http://www.iodbc.org for further details on using the iODBC driver manager.
Example of a Test on Linux
To test the ODBC connection on a Linux cluster, follow these steps:
Start Drill. For example, to start Drill in local mode on a linux cluster:
[root@centos23 drill-1.2.0]# bin/drill-localhost apache drill 1.2.0 "the only truly happy people are children, the creative minority and drill users"
samplesdirectory of the driver manager installation, run
[root@centos23 libiodbc-3.52.7]# samples/iodbctest iODBC Demonstration program This program shows an interactive SQL processor Driver Manager: 03.52.0709.0909
The prompt for an ODBC connection string appears.
Enter ODBC connect string (? shows list): ?
Type ? to see the DSN name.
DSN | Driver ------------------------------------------------------------------------------ Sample MapR Drill DSN 64 | MapR Drill ODBC Driver 64-bit Enter ODBC connect string (? shows list):
If you are connecting directly to a Drillbit, type an ODBC connection string using the following format:
DSN=<DSN name>;ConnectionType=Direct;Host=<Host Name>;Port=<Port Number>
If you are connecting to a ZooKeeper cluster, type an ODBC connection string using the following format:
DSN=<DSN Name>;ConnectionType=ZooKeeper;ZKQuorum=<Server1:Port1>,<Server2:Port2>;ZKClusterID=<Cluster Name>`
The output of a successful test is:
Driver: 188.8.131.521 (MapR Drill ODBC Driver) SQL>
SQL>prompt appears, type
quit;, and go to the Drill shell to run commands. Do not attempt to run SQL commands from this prompt.
Example Connection Strings
The following example shows a connection string for a direct connection:
DSN=Sample MapR Drill DSN 64;ConnectionType=Direct;Host=localhost;Port=31010
The following example shows a connection string for a ZooKeeper cluster connection:
DSN=Sample MapR Drill DSN 64;ConnectionType=ZooKeeper;ZKQuorum=centos23.lab:5181;ZKClusterID=docs41cluster-drillbits
Testing the ODBC Connection on Mac OS X
To test the ODBC connection on Mac OS X, follow these steps.
- Start Drill.
- Start the iODBC Administrator.app in
The iODBC Data Source Administrator dialog appears.
- On the User DSN tab, select the MapR Drill.
- Click Test.
The Login for Sample MapR Drill dialog appears.
- If you configured Basic Authentication in the
.odbc.ini, enter the user name and password you also configured; otherwise, click OK.
The success message appears.
Testing the ODBC Connection on Windows
To test the ODBC connection on Windows, follow these steps:
Follow instructions to configure the ODBC connection on Windows.
The MapR Drill ODBC Driver DSN Setup dialog is displayed.
Click the Test Button.