From 7b43eed24a592feae9b6ba8fa338fb9737bf089f Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Wed, 3 Sep 2014 18:37:06 -0500 Subject: Add ability to set reconnect flag on MySQL connections Add database server ping method to SQL classes --- src/sql/qsqldatabase.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/sql/qsqldatabase.cpp') diff --git a/src/sql/qsqldatabase.cpp b/src/sql/qsqldatabase.cpp index 8a4f885..9a16d1c 100644 --- a/src/sql/qsqldatabase.cpp +++ b/src/sql/qsqldatabase.cpp @@ -144,6 +144,7 @@ public: return FALSE; } void close() {} + bool ping() { return TRUE; } QSqlQuery createQuery() const { return QSqlQuery( new QNullResult(this) ); } }; @@ -795,6 +796,15 @@ void QSqlDatabase::close() d->driver->close(); } +/*! + Sends a ping to the database server. +*/ + +bool QSqlDatabase::ping() +{ + return d->driver->ping(); +} + /*! Returns TRUE if the database connection is currently open; otherwise returns FALSE. -- cgit v1.2.1