Installation guide
mxODBC - Python ODBC Database Interface
4.3.2 General Notes
Oracle tnsnames.ora file
When connecting to Oracle database you typically have to provide a
~/.tnsnames.ora file which has the network connection information of your
Oracle database servers.
If you want to use a different file location, be sure to set the environment variable
TNS_ADMIN to the path of the tnsnames.ora file.
4.4 IBM DB2
4.4.1 Available ODBC Drivers
IBM ODBC Driver for Unix/Windows DB2 servers
Tested with IBM DB2 9.7 ODBC driver.
IBM DB2 ships with ODBC drivers for DB2 on Windows, Linux and other Unix
systems. These can also be used to connect to DB2 database over a network.
Please see this page for more information:
http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=/com.ibm.db
2.udb.apdv.cli.doc/doc/c0023378.htm
Example Configuration for Unix
• Setup the network details of your DB2 database in the ~/.db2cli.ini file:
[ibmdb2]
DBAlias=SAMPLE
Hostname=db2.example.net
• Using the same section name, add a new section to your ~/.odbc.ini file.
[ibmdb2]
Driver = /usr/local/odbc-drivers/db2/clidriver/lib/libdb2.so
You will have to change the driver entry to the location where you copied
the ODBC driver and add the lib/ directory of the driver to your
LD_LIBRARY_PATH.
• You can then connect to your database via the connection string
"DSN=ibmdb2;UID=username;PWD=password".
46