I recently installed IBM DB2 ver 9.7 and the development library.
I went to the Qt src/plugins/sqldrivers/db2 directory and modified the pro file to get all the compile errors I could out:

Qt Code:
  1. TARGET = qsqldb2
  2.  
  3. HEADERS = ../../../sql/drivers/db2/qsql_db2.h
  4. SOURCES = main.cpp \
  5. ../../../sql/drivers/db2/qsql_db2.cpp
  6. INCLUDEPATH+=/opt/ibm/db2/V9.7/include
  7. LIBS+=-L/opt/ibm/db2/V9.7/lib32 -ldb2
  8.  
  9. # unix:!contains( LIBS, .*db2.* ):LIBS *= -ldb2
  10. # win32:!contains( LIBS, .*db2.* ):LIBS *= -ldb2cli
  11.  
  12. include(../qsqldriverbase.pri)
To copy to clipboard, switch view to plain text mode 

I get 2 warnings:

/home/vince/Downloads/Qt/qt-x11-opensource-src-4.5.2/src/plugins/sqldrivers/db2/../../../sql/drivers/db2/qsql_db2.cpp:1479: warning: enumeration value ‘FinishQuery’ not handled in switch
/home/vince/Downloads/Qt/qt-x11-opensource-src-4.5.2/src/plugins/sqldrivers/db2/../../../sql/drivers/db2/qsql_db2.cpp:299: warning: ‘double qGetDoubleData(SQLHANDLE, int, bool&)’ defined but not used
Deciding to ignore for now, I copied the library file to the /usr/share/qt4/plugins/sqldrivers directory but my app doesn't load the driver and the output indicates that the QDB2 driver isn't amongst the available drivers.

Anyone know what the problem is ?
Could the warnings stop the driver from loading ?