21 lines
331 B
C++
21 lines
331 B
C++
//
|
|
// Created by dongl on 23-4-25.
|
|
//
|
|
#include "linkDB.h"
|
|
|
|
DB::DB() {}
|
|
DB::~DB() {
|
|
delete pool;
|
|
}
|
|
|
|
ConnectionPool* DB::pool = nullptr;
|
|
|
|
mysqlpp::Connection* DB::link() {
|
|
if (pool == nullptr) {
|
|
pool = new ConnectionPool("124.221.152.192", "ims", "IMS", "WimTFC8N58kznx2k");
|
|
}
|
|
|
|
return pool->safe_grab();
|
|
}
|
|
|