This commit is contained in:
2025-10-20 22:28:37 +08:00
parent eeb5af98eb
commit 7d148d79c9
429 changed files with 13624 additions and 586480 deletions

View File

@@ -19,6 +19,7 @@ bool MySQL::open(const QString &host,
const QString &pwd,
const QString &dbName)
{
isConnectOK = false;
if (QSqlDatabase::contains("qt_mysql_conn"))
db_ = QSqlDatabase::database("qt_mysql_conn");
else
@@ -32,9 +33,11 @@ bool MySQL::open(const QString &host,
if (!db_.open()) {
qWarning() << timeStamp() << "【错误】连接失败:" << db_.lastError().text();
isConnectOK = false;
return false;
}
qInfo() << timeStamp() << "【信息】数据库连接成功";
isConnectOK = true;
return true;
}