Last Update: 18 November 2009
Product: StarSQL
Version: All
Article ID: SQV00SU004
An ODBC Driver Manager implements an API layer between an ODBC application and the ODBC drivers that provide access to specific databases. This ensures database independence for the application. In addition, the Driver Manager provides functions such as mapping between different ODBC API versions and allows Unicode applications to work with ANSI drivers.
On Windows, the Microsoft ODBC Driver Manager is included as a standard part of the Windows operating system.
On Linux and UNIX there are several options:
StarSQL ships with unixODBC. However, in some cases a user may wish to use another Driver Manager if it is included and supported by the ODBC application that is being used.
This technical document contains instructions on how to use StarSQL with the DataDirect Driver Manager. In the examples provided, we assume that the DataDirect Driver Manager is installed in /opt/odbc; you will need substitute the actual location for the software as installed your system.
You must match the bitwidth of the software components - on a 64-bit operating system, the ODBC application, the Driver Manager, and the ODBC driver (e.g. StarSQL) must all be either 64-bit or 32-bit.
The library search path environment variable should be set so that the Driver Manager can be located at the time of execution.
Solaris & Linux:
LD_LIBRARY_PATH=/opt/odbc/lib; export LD_LIBRARY_PATH
AIX:
LIBPATH=/opt/odbc/lib; export LIBPATHHP-UX:
SHLIB_PATH=/opt/odbc/lib; export SHLIB_PATH
Do not include the StarSQL-supplied unixODBC Driver Manager (e.g. /opt/starsql/odbc/lib) in the library search path if you are using the DataDirect Driver Manager.
DD_INSTALLDIR=/opt/odbc; export DD_INSTALLDIR
This is optional - you can instead specify InstallDir in the [ODBC] section of your odbc.ini file (see below).
Set this to the location of your odbc.ini file (typically $HOME/.odbc.ini or /opt/odbc/odbc.ini).
ODBCINI=$HOME/.odbc.ini; export ODBCINI
This file should contain your StarSQL data source; in addition, it should contain an ODBC block that looks something like this:
[ODBC]
IANAAppCodePage = 4
InstallDir = /opt/odbc
Trace = 0
TraceFile = /tmp/odbctrace.out
TraceDll = /opt/odbc/lib/odbctrac.so
If you fail to set ODBCINI, you may see this error message:
SQLState = 08004, [StarSQL][StarSQL CLI Driver]Some connection parameters are missing for Data Source.
Set this to the location of your odbcinst.ini file. Set this to either the odbcinst.ini file created during installation of StarSQL (typically /usr/local/etc/odbcinst.ini) or the DataDirect-supplied file /opt/odbc/odbcinst.ini. If you choose the latter, you must add the StarSQL driver information to this file; use a text editor to copy the [StarSQL] section from /usr/local/etc/odbcinst.ini to /opt/odbc/odbc.ini.
If you fail to set ODBCINST, you may see this error message:
SQLState = IM005, [DataDirect][ODBC lib] Driver's SQLAllocHandle on SQL_HANDLE_DBC failed
The StarSQL data source should use a full path for the Driver keyword
e.g.
Driver=/opt/starsql/lib/libSWODBC.so
Using Driver=StarSQL will result in the following error:
SQLState = IM003, [DataDirect][ODBC lib] Specified driver could not be loaded
On AIX, create a symbolic link for the StarSQL driver:
# cd /usr/lpp/starsql/lib
# ln -s libSWODBC.a libSWODBC.so
Otherwise you will see the following error:
SQLState = IM003, [DataDirect][ODBC lib] Specified driver could not be loaded
On AIX, the following error may occur if you use the DataDirect Driver Manager with an ODBC application that was linked with unixODBC, such as the sample applications that are included with StarSQL. To use these applications with the DataDirect Driver Manager, they should be rebuilt and linked with the DataDirect Driver Manager.
exec(): 0509-036 Cannot load program simpleconn because of the following errors:
0509-150 Dependent module /opt/odbc/lib/libodbc.a(libodbc.so.1) could not be loaded.
0509-152 Member libodbc.so.1 is not found in archive
The information in technical documents comes without any warranty or applicability for a specific purpose. The author(s) or distributor(s) will not accept responsibility for any damage incurred directly or indirectly through use of the information contained in these documents. The instructions may need to be modified to be appropriate for the hardware and software that has been installed and configured within a particular organization. The information in technical documents should be considered only as an example and may include information from various sources, including IBM, Microsoft, and other organizations.