The unixODBC Driver Manager is an open source ODBC driver manager for use on UNIX platforms. This driver manager is supported for ODBC applications on supported DB2® platforms. This topic presents some examples of possible build scripts and configurations you might want to use when using the unixODBC Driver Manager.
The following are sample build scripts for setting up your environment to use the unixODBC Driver Manager.
#! /bin/sh
echo "Unzipping and extracting"
gzip -d unixODBC-2.2.11.tar.gz
tar xf unixODBC-2.2.11.tar
cd unixODBC-2.2.11
#Comment this out if not AIX
export CC=xlc_r
export CCC=xlC_r
echo "Configuring, compiling and installing"
configure --prefix=$HOME --enable-gui=no --enable-drivers=no
make
make install
echo "Setting ini env vars."
export ODBCHOME=~/etc
export ODBCINI=~/odbc.ini
#Comment this out if not AIX
echo "Extracting unixODBC libraries"
cd ~/lib
ar -x libodbc.a
ar -x libodbcinst.a
ar -x libodbccr.a
echo "\n***Still need to set up your ini files"
#! /bin/sh
echo "Unzipping and extracting"
gzip -d unixODBC-2.2.11.tar.gz
tar xf unixODBC-2.2.11.tar
cd unixODBC-2.2.11
echo "Configuring, compiling and installing"
configure --prefix=$HOME --enable-gui=no --enable-drivers=no
make
make install
echo "Setting ini env vars."
export ODBCHOME=~/etc
export ODBCINI=~/odbc.ini
echo "\n***Still need to set up your ini files"
The following are sample user and system INI files for using the unixODBC Driver Manager.
[DEFAULT]
Driver = DB2
[SAMPLE]
DESCRIPTION = Connection to DB2
DRIVER = DB2
[DEFAULT]
Description = Default Driver
Driver = /u/db2inst1/sqllib/lib/db2.o
fileusage=1
dontdlclose=1
[DB2]
Description = DB2 Driver
Driver = /u/db2inst1/sqllib/lib/db2.o
fileusage=1
dontdlclose=1
[ODBC]
Trace = yes
Tracefile = /u/user/trc.log
This system INI file has the ODBC trace enabled, with the trace log file set to trc.log.