Russian Qt Forum
Сентябрь 30, 2024, 02:24 *
Добро пожаловать, Гость. Пожалуйста, войдите или зарегистрируйтесь.
Вам не пришло письмо с кодом активации?

Войти
 
  Начало   Форум  WIKI (Вики)FAQ Помощь Поиск Войти Регистрация  

Страниц: [1] 2   Вниз
  Печать  
Автор Тема: Драйвер для Oracle для Qt (Linux Kubuntu 9.10)  (Прочитано 15648 раз)
swift
Гость
« : Ноябрь 25, 2009, 10:00 »

Скажите пожалуйста а есть в открытом доступе драйвер для Oracle
и если есть то где его взять
а если нет то мог бы кто ни будь поделиться им
спасибо  Улыбающийся
Записан
crossly
Гость
« Ответ #1 : Ноябрь 25, 2009, 10:58 »

в исходниках src/sql/drivers/oci/
Записан
swift
Гость
« Ответ #2 : Ноябрь 25, 2009, 16:12 »

ээээ
скачал
qt-x11-opensource-src-4.5.3.tar.gz                            

зашел по указанному пути

дальше по инструкции из qt-assistant
cd $QTDIR/src/plugins/sqldrivers/oci
 qmake "INCLUDEPATH+=/usr/include/oracle/10.1.0.3/client" "LIBS+=-L/usr/lib/oracle/10.1.0.3/client/lib -Wl,-rpath,/usr/lib/oracle/10.1.0.3/client/lib -lclntsh -lnnz10" oci.pro
 make

в моем случае
cat $ORACLE_HOME
cat: /usr/lib/oracle/xe/app/oracle/product/10.2.0/server: Is a directory

cd /home/swift/Tmp/qt-x11-opensource-src-4.5.3/src/sql/drivers/oci
qmake -project (у меня нет oci.pro)
qmake "INCLUDEPATH+=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server" "LIBS+=-L/usr/lib/oracle/xe/app/oracle/product/10.2.0/server -Wl,-rpath,/usr/lib/oracle/10.1.0.3/client/lib -lclntsh -lnnz10" oci.pro (у меня стоит oracle XE)
make
и получаю
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I/usr/include/oracle/10.2.0/client -I. -I. -o qsql_oci.o qsql_oci.cpp                                                                                        
In file included from qsql_oci.cpp:42:                                                                                                                                              
qsql_oci.h:47:46: error: QtSql/private/qsqlcachedresult_p.h: No such file or directory                                                                                              
qsql_oci.cpp:50:23: error: qsqlerror.h: No such file or directory                                                                                                                  
qsql_oci.cpp:51:23: error: qsqlfield.h: No such file or directory                                                                                                                  
qsql_oci.cpp:52:23: error: qsqlindex.h: No such file or directory                                                                                                                  
qsql_oci.cpp:53:23: error: qsqlquery.h: No such file or directory                                                                                                                  
qsql_oci.cpp:59:17: error: oci.h: No such file or directory                                                                                                                        
In file included from qsql_oci.cpp:42:                                                                                                                                              
qsql_oci.h:68: error: expected class-name before ‘{’ token                                                                                                                          
qsql_oci.h:80: error: ‘ValueCache’ has not been declared                                                                                                                            
qsql_oci.cpp:80: error: ‘OCIStmt’ was not declared in this scope                                                                                                                    
qsql_oci.cpp:80: error: template argument 1 is invalid                                                                                                                              
qsql_oci.cpp:90: error: ‘ub1’ does not name a type                                                                                                                                  
qsql_oci.cpp:91: error: ‘ub2’ does not name a type                                                                                                                                  
qsql_oci.cpp:93: error: ‘sb2’ was not declared in this scope                                                                                                                        
qsql_oci.cpp:93: error: template argument 1 is invalid                                                                                                                              
qsql_oci.cpp:93: error: invalid type in declaration before ‘;’ token                                                                                                                
qsql_oci.cpp:94: error: ‘ub2’ was not declared in this scope                                                                                                                        
qsql_oci.cpp:94: error: template argument 1 is invalid                                                                                                                              
qsql_oci.cpp:94: error: invalid type in declaration before ‘;’ token                                                                                                                
qsql_oci.cpp:98: error: ‘OCIError’ was not declared in this scope                                                                                                                  
qsql_oci.cpp:98: error: ‘err’ was not declared in this scope                                                                                                                        
qsql_oci.cpp:98: error: expected primary-expression before ‘int’                                                                                                                    
qsql_oci.cpp:102: error: ‘OCIError’ has not been declared                                                                                                                          
qsql_oci.cpp:103: error: ‘QSqlError::ErrorType’ has not been declared                                                                                                              
qsql_oci.cpp:103: error: ‘OCIError’ has not been declared                                                                                                                          
qsql_oci.cpp:111: error: ISO C++ forbids declaration of ‘OCIRowid’ with no type                                                                                                    
qsql_oci.cpp:111: error: expected ‘;’ before ‘*’ token                                                                                                                              
qsql_oci.cpp: In constructor ‘QOCIRowId::QOCIRowId(OCIEnv*)’:                                                                                                                      
qsql_oci.cpp:118: error: class ‘QOCIRowId’ does not have any field named ‘id’                                                                                                      
qsql_oci.cpp:120: error: expected type-specifier before ‘dvoid’                                                                                                                    
qsql_oci.cpp:120: error: expected ‘>’ before ‘dvoid’                                                                                                                                
qsql_oci.cpp:120: error: expected ‘(’ before ‘dvoid’                                                                                                                                
qsql_oci.cpp:120: error: ‘dvoid’ was not declared in this scope                                                                                                                    
qsql_oci.cpp:120: error: expected primary-expression before ‘>’ token                                                                                                              
qsql_oci.cpp:120: error: ‘id’ was not declared in this scope                                                                                                                        
qsql_oci.cpp:121: error: ‘OCI_DTYPE_ROWID’ was not declared in this scope                                                                                                          
qsql_oci.cpp: In destructor ‘QOCIRowId::~QOCIRowId()’:                                                                                                                              
qsql_oci.cpp:126: error: ‘id’ was not declared in this scope                                                                                                                        
qsql_oci.cpp:127: error: ‘OCI_DTYPE_ROWID’ was not declared in this scope                                                                                                          
qsql_oci.cpp:127: error: ‘OCIDescriptorFree’ was not declared in this scope                                                                                                        
qsql_oci.cpp: At global scope:                                                                                                                                                      
qsql_oci.cpp:145: error: ISO C++ forbids declaration of ‘OCIError’ with no type                                                                                                    
qsql_oci.cpp:145: error: expected ‘;’ before ‘*’ token                                                                                                                              
qsql_oci.cpp:147: error: ISO C++ forbids declaration of ‘OCIStmt’ with no type                                                                                                      
qsql_oci.cpp:147: error: expected ‘;’ before ‘*’ token                                                                                                                              
qsql_oci.cpp:153: error: ‘OCIBind’ has not been declared                                                                                                                            
qsql_oci.cpp:155: error: ‘OCIStmt’ has not been declared                                                                                                                            
qsql_oci.cpp:155: error: ‘OCIBind’ has not been declared                                                                                                                            
qsql_oci.cpp:155: error: ‘OCIError’ has not been declared                                                                                                                          
qsql_oci.cpp:156: error: ‘dvoid’ has not been declared                                                                                                                              
qsql_oci.cpp:156: error: ‘ub2’ has not been declared                                                                                                                                
qsql_oci.cpp: In member function ‘bool QOCIResultPrivate::isOutValue(int) const’:                                                                                                  
qsql_oci.cpp:162: error: ‘class QOCIResult’ has no member named ‘bindValueType’                                                                                                    
qsql_oci.cpp: In member function ‘bool QOCIResultPrivate::isBinaryValue(int) const’:                                                                                                
qsql_oci.cpp:164: error: ‘class QOCIResult’ has no member named ‘bindValueType’                                                                                                    
qsql_oci.cpp: In member function ‘void QOCIResultPrivate::setStatementAttributes()’:                                                                                                
qsql_oci.cpp:174: error: ‘sql’ was not declared in this scope                                                                                                                      
qsql_oci.cpp:175: error: ‘OCI_HTYPE_STMT’ was not declared in this scope                                                                                                            
qsql_oci.cpp:178: error: ‘OCI_ATTR_PREFETCH_ROWS’ was not declared in this scope                                                                                                    
qsql_oci.cpp:179: error: ‘err’ was not declared in this scope                                                                                                                      
qsql_oci.cpp:179: error: ‘OCIAttrSet’ was not declared in this scope                                                                                                                
qsql_oci.cpp:185: error: ‘sql’ was not declared in this scope                                                                                                                      
qsql_oci.cpp:186: error: ‘OCI_HTYPE_STMT’ was not declared in this scope                                                                                                            
qsql_oci.cpp:189: error: ‘OCI_ATTR_PREFETCH_MEMORY’ was not declared in this scope                                                                                                  
qsql_oci.cpp:190: error: ‘err’ was not declared in this scope                                                                                                                      
qsql_oci.cpp:190: error: ‘OCIAttrSet’ was not declared in this scope                                                                                                                
qsql_oci.cpp: At global scope:                                                                                                                                                      
qsql_oci.cpp:197: error: variable or field ‘setCharset’ declared void                                                                                                              
qsql_oci.cpp:197: error: ‘OCIBind’ was not declared in this scope                                                                                                                  
qsql_oci.cpp:197: error: ‘hbnd’ was not declared in this scope
qsql_oci.cpp:215: error: ‘int QOCIResultPrivate::bindValue’ is not a static member of ‘struct QOCIResultPrivate’
qsql_oci.cpp:215: error: ‘OCIStmt’ was not declared in this scope
qsql_oci.cpp:215: error: ‘sql’ was not declared in this scope
qsql_oci.cpp:215: error: ‘OCIBind’ was not declared in this scope
qsql_oci.cpp:215: error: ‘hbnd’ was not declared in this scope
qsql_oci.cpp:215: error: ‘OCIError’ was not declared in this scope
qsql_oci.cpp:215: error: ‘err’ was not declared in this scope
qsql_oci.cpp:215: error: expected primary-expression before ‘int’
qsql_oci.cpp:216: error: expected primary-expression before ‘const’
qsql_oci.cpp:216: error: ‘dvoid’ was not declared in this scope
qsql_oci.cpp:216: error: ‘indPtr’ was not declared in this scope
qsql_oci.cpp:216: error: ‘ub2’ was not declared in this scope
qsql_oci.cpp:216: error: ‘tmpSize’ was not declared in this scope
qsql_oci.cpp:216: error: expected primary-expression before ‘&’ token
qsql_oci.cpp:216: error: ‘tmpStorage’ was not declared in this scope
qsql_oci.cpp:216: error: initializer expression list treated as compound expression
qsql_oci.cpp:217: error: expected ‘,’ or ‘;’ before ‘{’ token
qsql_oci.cpp:96: warning: ‘QByteArray qMakeOraDate(const QDateTime&)’ declared ‘static’ but never defined
qsql_oci.cpp:97: warning: ‘QDateTime qMakeDate(const char*)’ declared ‘static’ but never defined
qsql_oci.cpp:102: warning: ‘void qOraWarning(const char*, int*)’ declared ‘static’ but never defined
qsql_oci.cpp:103: warning: ‘QSqlError qMakeError(const QString&, int, int*)’ declared ‘static’ but never defined

« Последнее редактирование: Ноябрь 26, 2009, 10:23 от swift » Записан
swift
Гость
« Ответ #3 : Ноябрь 25, 2009, 16:38 »

изменил в make строчку
INCPATH       = -I/home/swift/Tmp/qt-x11-opensource-src-4.5.3/include -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I/usr/include/oracle/10.2.0/client -I. -I.


не помогло Грустный
Записан
prometey
Гость
« Ответ #4 : Ноябрь 25, 2009, 17:38 »

Тут похоже вышла небольшая путаница Улыбающийся на самом деле ответ
в исходниках src/sql/drivers/oci/

частично правилен. олько вот это дрйвер QT для оракла. который работает на основе ораклового драйвера с помощью интерфейса OCI. тебе необходим набор оракловых драйверов. их можно абсолютно бесплатно скачать с сайта оракла. для нужной тебе версии. вот линк: http://www.oracle.com/technology/software/products/database/index.html
сверху 11-ка, ниже 10-ка. выбери то что тебе надо и качай client
(например
Oracle Database 10g Client Release 2 (10.2.0.1.0) for Linux x86
10201_client_linux32.zip (478,343,213 bytes) (cksum - 579193942)
)

но это ты скачаешь кучу софта плюс кучу всякой лабуды. это наиболее легкий вариант. или же можно скачать т.н. instant client. находится это счастье по адресу http://www.oracle.com/technology/software/tech/oci/instantclient/index.html
распаковываешь всё это дело. потом устанавливаешь пути к либам, заголовочным файлам, и компилишь кутешный дривер. а вообще, на сколько помню где-то в доке кути было описание сборки дривера
Записан
swift
Гость
« Ответ #5 : Ноябрь 25, 2009, 17:58 »

брррр
но у меня стоит клиент Oracle
и как я понимаю туда драйвера уже входят.....

у меня пока проблема в том что я не могу собрать из исходников qt сей драйвер
Записан
UVV
Гость
« Ответ #6 : Ноябрь 26, 2009, 10:49 »

Ставь одиннадцатую.
Записан
swift
Гость
« Ответ #7 : Ноябрь 26, 2009, 10:52 »

Ставь одиннадцатую.

если у меня не будет коннектится то обязательно попробую 11
пока у меня не компилится сам драйвер
можно конечно сей ошибки с include править самому
но как то мне кажется это не совсем правильно
Записан
crossly
Гость
« Ответ #8 : Ноябрь 26, 2009, 12:06 »

в исходниках src/sql/drivers/oci/
это путь к самому драйверу.... для его сборки надо указать ключ при компиляции Qt (при этом он слинкуется с QtSql)... либо собрать плагин... он лежит там где и все src/plugins/sqldrivers
Записан
swift
Гость
« Ответ #9 : Ноябрь 26, 2009, 13:19 »

в исходниках src/sql/drivers/oci/
это путь к самому драйверу.... для его сборки надо указать ключ при компиляции Qt (при этом он слинкуется с QtSql)... либо собрать плагин... он лежит там где и все src/plugins/sqldrivers

так
я уже понял что немного налошил
файл oci.pro нашел
но обнаружил что у меня нет директории
/usr/include/oracle/.........

Записан
swift
Гость
« Ответ #10 : Ноябрь 26, 2009, 13:49 »

2prometey

ты гений
спасибо!!!!!

так
собрал
файл libqsqloci.so
кинул в
/usr/lib/qt4/plugins/sqldrivers
а что делать дальше?

QSqlDatabase: QOCI driver not loaded
QSqlDatabase: available drivers: QSQLITE QMYSQL3 QMYSQL QODBC3 QODBC
« Последнее редактирование: Ноябрь 26, 2009, 14:01 от swift » Записан
crossly
Гость
« Ответ #11 : Ноябрь 26, 2009, 14:31 »

что значит кинул??..... сделал make install??
Записан
swift
Гость
« Ответ #12 : Ноябрь 26, 2009, 14:32 »

что значит кинул??..... сделал make install??

да
swift@asus:~/Tmp/qt-x11-opensource-src-4.5.3/src/plugins/sqldrivers/oci$ sudo make install
[sudo] password for swift:
install -m 755 -p "libqsqloci.so" "/usr/lib/qt4/plugins/sqldrivers/libqsqloci.so"

а в ответ
swift@asus:~/Учеба/oracle.qt45$ ./oracle
QSqlDatabase: QOCI driver not loaded
QSqlDatabase: available drivers: QSQLITE QMYSQL3 QMYSQL QODBC3 QODBC
Записан
crossly
Гость
« Ответ #13 : Ноябрь 26, 2009, 14:34 »

какая версия qt в системе??
Записан
swift
Гость
« Ответ #14 : Ноябрь 26, 2009, 14:38 »

какая версия qt в системе??

эээээ
qt 4.5.2
Записан
Страниц: [1] 2   Вверх
  Печать  
 
Перейти в:  


Страница сгенерирована за 0.078 секунд. Запросов: 21.