solidDB 6.0
Updated: 11 May 2007
UnixODBC Guide for Solid Users
CONTENTS
- General Information
- Configuration Files
- Syntax of Configuration Files
- Location of Configuration files
- Configuration Examples
- Linking the Driver
GENERAL INFORMATION
UnixODBC
(http://www.unixodbc.org/) is an
ODBC driver manager for unix-like environment. Instead of linking an
application directly with the Solid ODBC driver, a UnixODBC driver can
be used.
CONFIGURATION FILES
UnixODBC can load the correct data source driver according to
the specifications in the following two configuration files:
- odbc.ini (or .odbc.ini), where the logical name of the data source and the actual ODBC driver is specified and
- odbcinst.ini (or .odbcinst.ini), where the logical driver name
is connected with its physical location in the file system.
In addition to the files above, the actual ODBC driver needs
a differently structured configuration file, solid.ini, where the
logical data source name is connected with the physical connect
string.
SYNTAX OF CONFIGURATION FILES
Syntax of odbc.ini
The odbc.ini (or .odbc.ini) file must present at least two
things for each data source:
- the logical name of the data source inside brackets,
for example [my_solid] and
- the
logical name of the actual ODBC driver to be used by using
the syntax Driver=<driver name>, for example Driver = solid_odbc.
An additional description can be added by using the syntax
Description=My first Solid
All additional information is ignored.
Syntax of odbcinst.ini
The logical name and the
physical location of the ODBC driver must be specified in the odbcinst.ini (or .odbcinst.ini) file as
follows:
- [<the logical name of the driver>] (for example, [solid_odbc]) and
- Driver = <absolute path to the driver> (for example, Driver = /home/jsmith/sacl2x45.so)
Syntax of Client-side solid.ini
In the solid.ini file, the logical data source names must be connected
to their physical connect strings. The syntax is described
further in solidDB Administrator Guide:
- [Data Sources] and
- <the logical data source name>
= <physical connect string> (for example, my_solid=tcp my_machine 1313)
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' and user-level drivers
in '~/.odbcinst.ini'
The client-side solid.ini file can be located either in the directory
set by the SOLIDDIR environment variable or in the current
working directory.
CONFIGURATION EXAMPLES
Examples of working configuration files:
~/.odbc.ini :
[foo]
Description = Testing Solid
Driver = solid_driver_45
~/.odbcinst.ini :
[solid_driver_45]
Description = The newest ODBC driver
Driver = /home/jsmith/Solid4.50.0022/bin/sacl2x45.so
$SOLIDDIR/solid.ini :
[Data Sources]
foo = tcp 1313
LINKING THE DRIVER
Linking UnixODBC instead of the actual driver can be done by
copying the UnixODBC driver to the correct location and replacing
LDFLAGS = $(SOLID_LIB)/linux/sacl2x45.so
with
LDFLAGS = $(SOLID_LIB)/linux/libodbc.so
Copyright (c) 2008 Solid Information Technology, Ltd.
All Rights Reserved.
|