UnixODBC Guide for TATP
CONTENTS
General information
UnixODBC
(http://www.unixodbc.org/) is an
ODBC driver manager for unix-like environment. Instead of linking an
application directly with an ODBC driver, unixODBC can be used.
Download and install unixODBC, then follow the instructions in the TATP Makefile to build TATP binaries linked to unixODBC.
Additionally, for each database product you are using, you need a proprietary driver delived as a shared
library.
Configuration files
UnixODBC can load the correct data source driver according to
the specifications of the following two configuration files:
- odbc.ini (or .odbc.ini), in which the logical name of the data source and the actual ODBC driver is specified
- odbcinst.ini, in which the logical driver name is connected with its physical location in the file system.
In addition to the files above, if the solidDB ODBC driver is to be used, it requires another file:
- solid.ini, in which the
logical data source name is connected with the physical connect string.
The solid.ini file, despite its name, includes
information for client-side driver only. It has to be located in the TATP working directory.
Syntax of configuration files
Syntax of odbc.ini
In odbc.ini (or .odbc.ini) for each data source, at least two
things should be presented:
- the logical name of the data source inside brackets: "[<data source name>]"
- the logical name of the actual ODBC driver to be used by using
the syntax "Driver = <driver name>"
- Inaddition, a description can be added.
An example:
[my_solid] Driver = solid_odbc Description = My first Solid data source
All other information is ignored.
Syntax of odbcinst.ini
In odbcinst.ini (or .odbcinst.ini) the logical name and the
physical location of the ODBC driver must be specified as
follows:
- [<the logical name of the driver>]
- Driver = <absolute path to the driver library>
- Threading = <threading parameter value (0,1,2,3) for unixODBC>, see unixODBC documentation for details
An example:
[solid_odbc] Driver = /home/jsmith/sacl2x6463.so Threading = 0
[Back to top]
Using solidDB ODBC driver and solid.ini
TATP stores the contents of the configuration file of the test database
into the TIRDB. Therefore the configuration of the database needs to be
copied to the location, which is specified in the ddf file
('configuration_file'). In solidDB that file is solid.ini.
Configuration information for client-side ODBC driver is stored
in client-side configuration file, also named solid.ini. These two
identically named files must be separated by storing them in different
locations in the file system.
In client-side solid.ini the logical data source names (used in unixODBC) are connected
to their physical connect strings as follows. The syntax is described
further in solidDB Administrator Guide.
- under [Data Sources] tag: <the logical data source name>
= <physical connect string>
An example:
my_solid = tcp localhost 1964
[Back to top]
Location of the configuration files
System-level data sources are specified in
'/usr/local/etc/odbc.ini'. User-level DSNs are specified
in '~/.odbc.ini'. In a similar way, system-level drivers are
specified in '/usr/local/etc/odbcinst.ini'.
Client-side solid.ini can be located either in the directory
set by the SOLIDDIR environment variable or in the current
working directory.
[Back to top]
Troubleshooting
Building TATP in Linux with unixODBC
If you are building TATP in Linux with unixODBC and you get the
following error message: "/usr/bin/ld: cannot find -lodbc"
it might be because of a missing symbolic link. In order to fix this problem
you should try the following.
- Locate the systems unixODBC libraries (probably under /usr/lib)
- List all the files starting with libodbc.so (ls -l /usr/lib/libodbc.so*)
- If the command does not return a file called "libodbc.so", but does return
other files like:
ls -l /usr/lib/libodbc.so* lrwxrwxrwx 1 root root 16 ... /usr/lib/libodbc.so.1 -> libodbc.so.1.0.0 -rw-r--r-- 1 root root 382096 ... /usr/lib/libodbc.so.1.0.0
then the problem might be because of a missing symbolic link.
- Run the following command as root:
ln -s /usr/lib/libodbc.so.1 /usr/lib/libodbc.so
Now ls -l /usr/lib/libodbc.so* should return:
ls -l /usr/lib/libodbc.so* lrwxrwxrwx 1 root root 21 ... /usr/lib/libodbc.so -> /usr/lib/libodbc.so.1 lrwxrwxrwx 1 root root 16 ... /usr/lib/libodbc.so.1 -> libodbc.so.1.0.0 -rw-r--r-- 1 root root 382096 ... /usr/lib/libodbc.so.1.0.0
- Try building TATP again
[Back to top]
|