solidDB Help : Programming : solidDB ODBC API : Connecting to a data source : Using unixODBC driver manager
  
Using unixODBC driver manager
unixODBC is an ODBC driver manager for UNIX type environments. Instead of linking an application directly with the solidDB ODBC driver, you can use a unixODBC as your driver manager.
You can also use unixODBC to provide tracing at the ODBC level.
Note For programs that have no native interface to solidDB (for example, Go, Perl, and Python), either use unixODBC or, if performance is not an issue, use HTTP, see solidDB HTTP SQL Access.
For detailed information about unixODBC, see http://www.unixodbc.org/.
The unixODBC driver manager loads the correct data source driver according to the specifications in the following configuration files:
odbc.ini or .odbc.ini: specifies the logical name of the data source and the actual ODBC driver.
The odbc.ini file defines the system-level settings that are available to all users. The .odbc.ini file defines user-level settings.
odbcinst.ini: connects the logical driver name with its physical location in the file system.
The odbcinst.ini is a system-level file.
In addition to these files, the solidDB ODBC driver needs a client-side solid.ini configuration file where the logical data source name is connected with the a valid solidDB connect string.
Syntax of the odbc.ini configuration files
The odbc.ini or .odbc.ini file must include at least the following two items for each data source:
Logical name of the data source inside brackets, for example [solid_ds]
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=SolidDB connection
All additional information is ignored.
Syntax of the odbcinst.ini configuration file
The logical name and the physical location of the ODBC driver must be specified in the odbcinst.ini file as follows:
[logical_name_of_driver],
Driver = absolute_path_to_driver,
For example:
[solid_odbc]
Driver = /home/js/sacl2x64.so
Syntax of the client-side solid.ini configuration file
In the client-side solid.ini file, the logical data source name must be connected to a valid solidDB connect string (network name) as follows:
[Data Sources]
logical_data_source_name = connect_string
For example:
[Data Sources]
solid_ds=tcp my_machine 1964
Location of the configuration files
The system-level configuration files, odbc.ini and odbcinst.ini are located in a system level configuration directory, such as /etc/. For example:
/usr/local/etc/odbc.ini
/usr/local/etc/odbcinst.ini
User-level data sources are specified in ~/.odbc.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.
Linking the driver
To link to the unixODBC driver instead of the solidDB ODBC driver:
1 Copy the unixODBC driver (libodbc.so) to a location of your choice.
2 Replace the solidDB ODBC driver library file with the unixODBC library file. For example:
Replace the direct linking:
LDFLAGS = $(SOLID_LIB)/bin/sacl2x70.so
with the unixODBC driver manager:
LDFLAGS = -lodbc.so
Go up to
Connecting to a data source