Developing Applications with GemFire XD / Using ODBC Driver Functions in Client Applications |
This topic describes how to install and configure the ODBC driver on Linux and Mac OSX platforms. The GemFire XD ODBC driver also provides command-line tools to simplify driver installation and configuration.
The ODBC driver binaries are distributed for Linux-based platforms in a .zip or .tar.gz file. Binaries are available for 32-bit and 64-bit architectures and differ depending on the supported driver manager (either iODBC or unixODBC) that you are using. See ODBC Driver Supported Configurations for a list of supported platform architectures and driver managers.
If you are using an ODBC driver manager, you can configure the ODBC driver by manually modifying your odbcinst.ini and odbc.ini files or by using the odbc-installer or iodbc-installer tool.
You can also use a ODBC driver manager to map deprecated 2.0 to 3.5 ODBC function calls. See "Mapping Replacement Functions for Backward Compatibility of Applications" for more information.
If you are not using an ODBC driver manager, you can use the GemFire XD ODBC driver by directly linking to the driver library in your client application.
tar -zxvf Pivotal_GemFireXD_XX_bNNNNN_ODBC.tar.gz -C path_to_install_locationwhere path_to_install_location is an already existing directory.
[ODBC] Trace = yes TraceFile = dmtrace.log [ODBC Drivers] SQLFODBC = Installed [SQLFODBC] Driver = /usr/lib/gphd/gfxd/odbc/64/libgemfirexdodbc.so Description = Driver for connecting to GemFire XD database server
[ODBC Data Sources] data_source_name = testdsn [testdsn] Driver = /usr/lib/gphd/gfxd/odbc/64/libgemfirexdodbc.so DESCRIPTION = GemFire XD ODBC driver SERVER = localhost PORT = 1527 UID = PASSWORD = LogFile = gfxdodbc.log
export ODBCINI=/home/user/odbc.ini export ODBCINSTINI=/home/user/odbcinst.ini export ODBCSYSINI=/home/user/odbcinst.ini
export DYLD_LIBRARY_PATH=path_to_install_location
As an alternative to manually editing your system .ini files, you can use the command-line odbc-installer and iodbc-installer application that is provided with the GemFire XD ODBC driver to install and configure the driver.
The GemFire XD ODBC driver includes two different tools based on the driver manager that you are using. Use the odbc-installer tool if you are using the unixODBC driver manager. Use iodbc-installer if you are using the iODBC driver manager. The odbc-installer and iodbc-installer tools allow you to install and uninstall the driver, configure the DSN, and query driver and data source information.
For unixODBC users
tar -zxvf Pivotal_GemFireXD_XX_bNNNNN_ODBC.tar.gz -C path_to_install_locationwhere path_to_install_location is an already existing directory.
export LD_LIBRARY_PATH=/unixODBC/lib:$LD_LIBRARY_PATHFor the unixODBC driver manager, odbc-installer should pick up libodbcinst.so.2. You can see the list of the shared libraries used by the odbc-installer by using ldd. For example:
ldd odbc-installer
export ODBCINI=/home/user/odbc.ini export ODBCSYSINI=/home/user/odbcinst.ini
export DYLD_LIBRARY_PATH=path_to_install_location
odbc-installer -d -a -n"GemFire XD ODBC 1.0 Driver" -t"GemFire XD ODBC 1.0 Driver;Driver=libgemfirexdodbc.so;Setup=libgemfirexdodbc.so;APILevel=2;UID=;PWD="
For iODBC users
tar -zxvf Pivotal_GemFireXD_XX_bNNNNN_ODBC.tar.gz -C path_to_install_locationwhere path_to_install_location is an already existing directory.
export LD_LIBRARY_PATH=/iODBC/lib:$LD_LIBRARY_PATHFor the iODBC driver manager, iodbc-installer should pick up libiodbcinst.so.2. You can see the list of the shared libraries used by the iodbc-installer by using ldd. For example:
ldd iodbc-installer
export ODBCINI=/home/user/odbc.ini export ODBCINSTINI=/home/user/odbcinst.ini export ODBCSYSINI=/home/user/odbcinst.ini
export DYLD_LIBRARY_PATH=path_to_install_location
iodbc-installer -d -a -n"GemFire XD ODBC 1.0 Driver" -t"GemFire XD ODBC 1.0 Driver;Driver=libgemfirexdiodbc.so;Setup=libgemfirexdiodbc.so;APILevel=2;UID=;PWD="