Qt远程连接Oracle数据库
一:代码 /**连接Oracle数据库 *数据库名:abc *表名:my_oracle *用户名:system *密码:123 *端口号:(默认)
一:代码
二:连接过程遇到的问题。
问题1:
QSqlDatabase: QOCI driver not loaded
QSqlDatabase:available drivers: QSQLITE QODBC3 QODBC
(1)出错原因:本连接是通过QMYSQL驱动,而Qt本身并没有QOCI驱动(只有QSQLITE QODBC3 QODBC),
所以就需要自己编译QOCI。
(2)编译QOCI驱动。
1.go to "Qt Command Prompt" window. (开始-程序-对应的qt项里面去找)。
2.qmake "INCLUDEPATH+=c:\oracle\oci\include" "LIBS+=-Lc:\oracle\oci\lib\msvc" oci.pro
3.qmake "INCLUDEPATH+=D:\oracle_setup\app\admin\product\11.1.0\db_3\OCI\include" "LIBS+=-LD:\oracle_setup\app\admin\product\11.1.0\db_3\OCI\lib\msvc" oci.pro
4.mingw32-make
问题2:
出现错误:
D:\qt_sdk\qt\src\plugins\sqldrivers\oci>mingw32-make
mingw32-make -f Makefile.Debug all
mingw32-make[1]: Entering directory `D:/qt_sdk/qt/src/plugins/sqldrivers/oci'
mingw32-make[1]: Nothing to be done for `all'.
mingw32-make[1]: Leaving directory `D:/qt_sdk/qt/src/plugins/sqldrivers/oci'
mingw32-make -f Makefile.Release all
mingw32-make[1]: Entering directory `D:/qt_sdk/qt/src/plugins/sqldrivers/oci'
mingw32-make[1]: Nothing to be done for `all'.
mingw32-make[1]: Leaving directory `D:/qt_sdk/qt/src/plugins/sqldrivers/oci'
出错原因:这个问题表示QOCI驱动已经被编译过了!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

Article discusses strategies for handling large datasets in MySQL, including partitioning, sharding, indexing, and query optimization.

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]

The article discusses dropping tables in MySQL using the DROP TABLE statement, emphasizing precautions and risks. It highlights that the action is irreversible without backups, detailing recovery methods and potential production environment hazards.

Article discusses using foreign keys to represent relationships in databases, focusing on best practices, data integrity, and common pitfalls to avoid.

The article discusses creating indexes on JSON columns in various databases like PostgreSQL, MySQL, and MongoDB to enhance query performance. It explains the syntax and benefits of indexing specific JSON paths, and lists supported database systems.

Article discusses securing MySQL against SQL injection and brute-force attacks using prepared statements, input validation, and strong password policies.(159 characters)
