Contents
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
[sample]
Description = db2
Driver = DB2
Add the driver details into odbcinst.ini.
The IBM CLI driver libdb2.so, supports the ODBC API.
>cat odbcinst.ini
[DB2]
Description = DB2 Driver
Driver = /usr/IBMdb2/V7.1/lib/libdb2.so
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/libdb2.so
If for some reason there are missing libraries you can add
/usr/IBMdb2/V7.1/lib/
to /etc/ld.so.conf
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
fi
After the config files are set up, we can check to connect using tksql.
> tksql UID/PWD@DSN
Connected to:
testdb
SQL>
Check if there are any errors and try to fix them.
For any questions, please send us an email.