qt oracle mingw oci drivers

1.程序目录应该全为英文,不要包含中文
2.采用mingw编译器编译 若采用msvc2008/msvc2010,
则qsqloci(d)4.dll和qcncodecs(d)4.dll也要采用相同的编译器mingw/msvc2008/msvc2010
3.程序目录下 
 procpath
    sqldrivers
    codecs
    proc.exe
    mingwm10.dll
    libgcc_s_dw2-1.dll
    oci.dll
    QtCored4.dll
    QtGuid4.dll
    QtSqld4.dll

sqldrivers
    qsqlocid4.dll
    qsqloci4.dll
    libqsqloci4.a
    libqsqlocid4.a

codecs
    qcncodecsd4.dll
    qcncodecs4.dll
    libqcncodecsd4.a
    libqcncodecs4.a

sqldrivers/codecs目录必须在程序目录下,且sqldrivers/codecs目录名称全部小写

如何获取oci.dll?
其中oci.dll为oracle安装程序目录oracle\product\10.2.0\db_1\BIN下的移植过来,
若程序目录下没有oci.dll则提示“Driver not loaded”

如何获取qsqlocid4.dll/qsqloci4.dll/libqsqloci4.a/libqsqlocid4.a?
qt安装时安装目录下D:\qtsdk1.2.1\Desktop\Qt\4.8.1\mingw\plugins\sqldrivers\目录下只支持sqlite和sqlserver
(qsqlite(d)4.dll和qsqlodbc(d)4.dll)

sqldrivers目录下的qsqloci(d)4.dll为qtcreator采用mingw编译器4.8.1
编译qt源码D:\qtsdk1.2.1\QtSources\4.8.1\src\plugins\sqldrivers\oci

1.修改qsql_ori.pri文件
增加内容如下:
#added by hls begin on 2012-4-28 16:41
INCLUDEPATH += D:/qtsdk1.2.1/QtSources/4.8.1/src
INCLUDEPATH +=D:/oracle/product/10.2.0/db_1/OCI/include

LIBS += -LD:/oracle/product/10.2.0/db_1/LIB
LIBS += -LD:/oracle/product/10.2.0/db_1/BIN
#added by hls end on 2012-4-28 16:42

2.修改qsql_oci.h
修改内容如下:
//modified by hls begin on 2012-4-28 16:43
//#include
#include "sql/kernel/qsqlcachedresult_p.h"
//modified by hls end on 2012-4-28 16:45

3.采用qt4.8.1的mingw编译器编译oci.pro

将编译好的qsqlocid4.dll/qsqloci4.dll/libqsqloci4.a/libqsqlocid4.a拷贝到
qt的安装目录下D:\qtsdk1.2.1\Desktop\Qt\4.8.1\mingw\plugins\sqldrivers下

你可能感兴趣的:(c++,open_source,qt,database)