当前位置:网站首页>QT database connection
QT database connection
2022-06-25 14:49:00 【Happy Jiajia】
qt Database connection
QSqlDatabase: You can provide a default connection for Qt Other SQL Class uses .
QSqlQuery class , Provides direct execution of arbitrary SQL Statement and process the method that returns the result .
Database connection be used QSqlDatabase And in its classes :: database and addDatabase,
QString g_sThreadId;
QSqlDatabase db = QSqlDatabase::database(g_sThreadId);
if (! db.isValid()) {
// Parameters 1 Is the driver name , Parameters 2 Name connection name and database The parameters in are the same , Or there is no connection name
db = QSqlDatabase::addDatabase(sDriver, g_sThreadId);
db.setDatabaseName(sDBName);
db.setUserName(sUserName);
db.setPassword(sPassword);
db.setHostName(sServerName);
db.open(); // Create a connection to the database
}
边栏推荐
- For the first time in China, Chinatelecom 5g underground personnel positioning project is officially commercial: it can track the position in real time to ensure operation safety
- Yolov3 spp Darknet version to caffemodel and then to OM model
- JGG | 河北大学杜会龙组综述植物泛基因组学研究
- New good friend Pinia, leading the new era of state management
- 15 -- 最接近原点的 K 个点
- 【中國海洋大學】考研初試複試資料分享
- Page 112 machine learning - review of fundamentals of mathematics pptx
- Two methods to rollback the code in pycharm to the specified version (with screenshot)
- JS to verify whether the string is a regular expression
- 搭建极简GB28181 网守和网关服务器,建立AI推理和3d服务场景,然后开源代码(一)
猜你喜欢

Yolov3 spp Darknet version to caffemodel and then to OM model

Uniapp cloud packaging app

Jaspersoft studio adding MySQL database configuration

中国电池技术取得重大突破,日韩美都落后了,中国巩固了领先优势

How to crop GIF dynamic graph? Take this picture online clipping tool

从0到1完全掌握 XSS

oracle数据库常用的函数总结

JGG | 河北大学杜会龙组综述植物泛基因组学研究

关于win10 版本kicad 卡死的问题, 版本6.x

2022年广东高考分数线出炉,一个几家欢喜几家愁
随机推荐
15 -- k points closest to the origin
分饼干问题
多张动图怎样合成一张gif?仅需三步快速生成gif动画图片
2022年广东高考分数线出炉,一个几家欢喜几家愁
买卖股票的最佳时机
The best screenshot tool in the world, color absorption tool snipaste
Biscuit distribution
Build a minimalist gb28181 gatekeeper and gateway server, establish AI reasoning and 3D service scenarios, and then open source code (I)
Real variable instance
C language LNK2019 unresolved external symbols_ Main error
Using Sphinx to automatically generate API documents from py source files
Jaspersoft studio installation
Kubernetes understands kubectl/ debugging
Compile Caffe's project using cmake
Extend JS copy content to clipboard
New good friend Pinia, leading the new era of state management
[world history] Episode II: Dawn of civilization
Which is better and safer, GF easy gold rush or flush
重磅!国产 IDE 发布,由阿里研发,完全开源!(高性能+高定制性)
Summary of common functions in Oracle Database