tags:

views:

308

answers:

1

Hi All,

I need to link our C/C++ code that is using the DB2 ODBC driver on linux, and although ive pulled in sqlcli.h I dont know where to find the objects so i can link.

Ive installed DB2 v9.1 ESE so i wouldve thought i could get everything.

Anybody got any ideas?

+1  A: 

Your application (on the client) would link to a Unix ODBC library -- either iODBC or unixodbc. Both are commonly available on Debian and Ubuntu and other distros.

Next, you install the ODBC driver from the server database. This means you need to get a DB2 ODBC driver onto your system.

With that, your application is capable of 'talking ODBC' and has someone to talk to: the ODBC driver of DB2.

To give another concrete example, I compile RODBC again unixodbc-dev for Debian and can then talk via ODBC to MySQL and Postgresql as I have drivers for both. [ This is of course contrived as both MySQL and Postgresql have native drivers too, but it servers as a test of RODBC. ]

Dirk Eddelbuettel
So the DB2 ODBC driver is on the server, and my client application just links with Unixodbc?
Mark Underwood
No, you need a DB2 ODBC driver for your operating system to be installed on your client machine. That way you enable (on the client) a 'conversation' about ODBC that this DB2 driver can then link back to the server.
Dirk Eddelbuettel
right. Cheers!. Im still having trouble connecting but i think i have it worked out.
Mark Underwood