Home Page        Calendar        Wiki    
   

Database Information

 

Link and information about database resources

 

IBM DB2 Links

Python Database Links

mxODBC Python Database Interface

Links

Installation

  1. Obtain the latest egenix-mx-base and egenix-mx-commercial tar ball from the egenics web site and uncompress them into a suitable build directory, e.g. /usr/src/python/
  2. Build the mx-base package by
    cd egenix-mx-base-2.0.4/
    python2.2 setup.py install
  3. Configure the mx-commercial package. This comes preconfigured to use iODBC and unixODBC, so needs it's configuration files modified to allow it to talk to DB2. First configure the DB2 C interface package by
    cd egenix-mx-commercial-2.0.5/mx/ODBC/DB2/
    make -f Makefile.pre.in Makefile VERSION=2.2 installdir=/usr
  4. Edit the file Setup and uncomment the lines
            -DIBMDB2         -DDONT_USE_SQLEXECDIRECT         -I/usr/IBMdb2/V7.1/include         -L/usr/IBMdb2/V7.1/lib -ldb2
    and make the mxODBC shared object.
  5. Change back to the root directory of the source (cd ../../../) and edit the file mxCOMMERCIAL.py
  6. In the Pure Python modules section, remove the lines that refer to mx.ODBC.iODBC and mx.ODBC.unixODBC and add a line for mx.ODBC.DB2
  7. In the C Extensions section, remove the blocks of code that refer to iODBC and unixODBC and add the following code for DB2:
    Extension('mx.ODBC.DB2.mxODBC',
       ['mx/ODBC/DB2/mxODBC.c',
        'mx/ODBC/DB2/mxSQLCodes.c'
        ],
       include_dirs=['mx/ODBC/DB2',
                     '/usr/IBMdb2/V7.1/include'],
       define_macros=[('IBMDB2', None),('DONT_USE_SQLEXECDIRECT', None)],
                      library_dirs=['/usr/IBMdb2/V7.1/lib'],
                      libraries=['db2']
                      ),
  8. Now build and install by running
    python2.2 setup.py install