Nip DATA Logo  


General Questions

How to setup DB2 odbc driver to work with DataArchitect ?

  •   Install the DB2 Client access package or server from IBM.
  It will install the IBM CLI driver, which works with unixODBC as a ODBC driver.

 Add the database connection info in odbc.ini:

>cat  ~/.odbc.ini
Description = db2
Driver           = DB2

  Add the driver details into odbcinst.ini.
The IBM CLI driver, supports the ODBC API.

>cat odbcinst.ini
Description     = DB2 Driver
Driver               = /usr/IBMdb2/V7.1/lib/
FileUsage        = 1
DontDLClose  = 1

  This example is for DB2 7.1 but it will work with a later release as well.
If the above doesn't work you can try to see if all the libraries required by the driver are available.

>ldd /usr/IBMdb2/V7.1/lib/

If for some reason there are missing libraries you can add /usr/IBMdb2/V7.1/lib/
to /etc/

IBM supply a script that sets DB2INSTANCE and LIBPATH. Here's what IBM suggests you put in your .bashrc or .profile if the DB2 instance you want to talk to is in /home/db2inst1:

if [ -f /home/db2inst1/sqllib/db2profile ]; then
. /home/db2inst1/sqllib/db2profile

  •    Test the new connection.
           After the config files are set up, we can check to connect using tksql.
  > tksql  UID/PWD@DSN
Connected to:


  Check if there are any errors and try to fix them.
For any questions, please send us an email.