2025-03-12 11:08:50 +08:00
|
|
|
|
#ifndef CDBMYSQL_H_
|
|
|
|
|
|
#define CDBMYSQL_H_
|
|
|
|
|
|
|
|
|
|
|
|
#include "CDbBaseApi_impl.h"
|
|
|
|
|
|
|
2025-03-12 14:17:01 +08:00
|
|
|
|
namespace iot_dbms
|
2025-03-12 11:08:50 +08:00
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
class CDbMySQLApi : public CDbBaseApi_impl
|
|
|
|
|
|
{
|
|
|
|
|
|
public:
|
|
|
|
|
|
CDbMySQLApi();
|
|
|
|
|
|
CDbMySQLApi( const CDbPara& objDbPara );
|
|
|
|
|
|
~CDbMySQLApi();
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
bool doAfterOpen();
|
|
|
|
|
|
bool needReconnect();
|
|
|
|
|
|
bool drop( const QString& sTableName );
|
|
|
|
|
|
QString getDriverStr() const;
|
|
|
|
|
|
void setConnectOptions() override;
|
|
|
|
|
|
QString addQuoteMarks( const QString& sStr ) const;
|
|
|
|
|
|
QString convertQuoteMarks( const QString& sStr ) const;
|
|
|
|
|
|
QString convertToSqlString( const QDateTime& dt ) const;
|
|
|
|
|
|
QString getHostName();
|
|
|
|
|
|
bool lockTable( const QString& sTabelName );
|
|
|
|
|
|
bool unlockTable();
|
|
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
#endif
|