Using CData ODBC Drivers in Mac & Linux/Unix Environments



Our ODBC drivers support unixODBC and iODBC, the most popular driver managers for Unix/Linux environments and Mac OS X, giving you unprecedented access to your Big Data, NoSQL, and SaaS sources from ODBC-capable tools and applications, no matter what operating system you use. This article will walk you through the installation and configuration of any of our ODBC drivers on Mac OS X, Red Hat Linux, and Debian-based Linux environments like Ubuntu. The ODBC Driver for Salesforce is used as an example.



Using the CData ODBC Drivers on a Unix/Linux Machine

Below are the minimum supported versions for Red Hat-based and Debian-based systems:

  • Ubuntu: 11
  • Debian: 7
  • RHEL: 6
  • CentOS: 6
  • Fedora: 13

See the "Getting Started" section in the help documentation for the libraries required by the driver.

Installing the Driver Manager

Before installing the driver, you need to be sure that your system has a driver manager. unixODBC is a free and open source ODBC driver manager that is widely supported.

For Debian-based systems like Ubuntu, you can install unixODBC with the APT package manager:

apt-get install unixodbc unixodbc-dev

For systems based on Red Hat Linux, you can install unixODBC with yum or dnf:

yum install unixODBC unixODBC-devel

The unixODBC driver manager reads information about drivers from an odbcinst.ini file and about data sources from an odbc.ini file. You can determine the location of the configuration files on your system by entering the following command into a terminal:

odbcinst -j

The output of the command will display the locations of the configuration files for ODBC data sources and registered ODBC drivers. User data sources can only be accessed by the user account whose home folder the odbc.ini is located in. System data sources can be accessed by all users. Below is an example of the output of this command:

DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
FILE DATA SOURCES..: /etc/ODBCDataSources
USER DATA SOURCES..: /home/myuser/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8

Installing the Driver

iYou can downloading the driver in standard packages formats, the Debian .deb package format or the .rpm file format. Once you have downloaded the file, you can install the driver from the terminal.

The driver installer registers the driver with unixODBC and creates a system DSN, which can be used later in any tools or applications that support ODBC connectivity.

For Debian-based systems like Ubuntu, run the following command as root or with sudo

dpkg -i /path/to/package.deb

For systems that support .rpms, run the following command as root or with sudo

rpm -i /path/to/package.rpm

Create a DSN

Define the required connection properties in sections of an odbc.ini file. The section name is the DSN. Refer to the "Getting Started" section in the help documentation for more information on the connection properties needed to connect to your data source.

You will also need to set the Driver property to the name of the driver as defined in the odbcinst.ini.

[CData Salesforce Source]
Driver = CData ODBC Driver for Salesforce
Description = My Description
MyConnectionProperty1 = My Value
MyConnectionProperty2 = My Value2


Installing the CData ODBC Drivers on Mac OS X

There are several options for user-friendly interfaces when it comes to configuring ODBC data sources on Mac OS X. However, a GUI still relies on an ODBC driver manager. The CData ODBC drivers are preconfigured for the iODBC driver manager, as are many other products like Filemaker Pro and Microsoft Excel for Mac. This makes the driver easy to use with these tools.

Another driver manager, unixODBC, is widely supported by scripting languages like Python and Ruby. For a guide to creating and testing DSNs with unixODBC, see the "Getting Started" section in the help documentation.

Installing iODBC

You can find the latest version of iODBC on the iODBC site. The iODBC installation installs its own GUI, the iODBC Administrator. It is this tool that is used in the following procedure to create a DSN.

Creating a DSN for iODBC

Installing a CData ODBC Driver registers the driver with the iODBC driver manager, so the only remaining step is to use the iODBC Administrator to supply the necessary connection properties in a DSN. The driver installation automatically creates a system DSN. System DSNs can be accessed by all users, while user DSNs can only be accessed by a single user. However, modifying a system DSN requires elevated permissions.

  1. Open a terminal and enter the following command to start the iODBC Administrator with the necessary permissions:
    sudo /Applications/iODBC/iODBC\ Administrator.app/Contents/MacOS/iODBC\ Administrator
    
  2. On the System tab, select CData Salesforce Source.
  3. Click the Add button to enter connection properties as key-value pairs.

    If you wish to authenticate using OAuth, you will need to add an additional key-value pair to the DSN to ensure that the OAuth flow can execute properly:

    Keyword  Value
    OtherCheckPromptMode=False

    For more information on the connection properties needed for your data source, refer to the driver help documentation.

Using Configuration Files

While it is recommended that you use the iODBC Administrator GUI to create ODBC data sources, you can also modify the configuration files of the iODBC driver manager. The iODBC driver manager uses the following files:

  • odbci.ini - The file used to define individual ODBC data sources.
  • odbcinst.ini - The file containing the ODBC drivers registered with the driver manager. With iODBC, drivers can be available to only one user account or the drivers can be available to all users in a system, as with DSNs.

You can modify the files at the paths below, depending on the level of access you want.

     Privileges      Path
User /Users/myuser/Library/ODBC/
System /Library/ODBC/

For specific information on using these configuration files, please refer to the help documentation included in the installation of the drivers.



Download Free Trials

To download free 30-day trial versions of any ODBC Driver, select an ODBC Driver data source on our driver listing page, and navigate to the download page.