我正在使用MySql C ++ Connector驱动程序,并且它没有mysql_ping()
函数(至少来自this official link here
至于给定的链接,类似上面的代码会起作用:
if (connection->isClosed())
connection->reconnect();
问题是reconnect
也不存在。我的代码无法使用此错误进行编译:
class sql::Connection has no member named ‘reconnect’
PS:驱动程序类SqlDriver*
也没有重新连接。
如何使用C ++连接器调用或模拟mysql_ping()
?