Files
Sun1602/Server/ShopServer/Uitl/DBProc.h
T
2022-10-26 12:25:11 +08:00

50 lines
1.5 KiB
C++

#pragma once
#include "SqlLibHandler.h"
#include "WorkerThread.h"
#include <string>
class CDBProc : public CWorkerThread
{
public:
CDBProc(void);
~CDBProc(void);
bool ConnectDBMS(char* strCon, char* szID, char* szPwd);
bool ConnectDBMS(char* strIP, UINT nPortNum, char* szDbName, char* szID, char* szPwd, bool bDBConnect = true);
bool SetQureyText(const char* szQurey);
bool ExecSP();
protected:
virtual void RunProc();
bool IsConnected();
int GetCountFiled();
bool FetchNext();
bool ModifyValue(VALUE_TYPE vt, const char* szCol, tm& _time);
bool ModifyValue(VALUE_TYPE vt, const char* szCol, long& nValue);
bool ModifyValue(VALUE_TYPE vt, const char* szCol, short& nValue);
bool ModifyValue(VALUE_TYPE vt, const char* szCol, double& nValue);
bool ModifyValue(VALUE_TYPE vt, const char* szCol, int& nValue);
bool ModifyValue(VALUE_TYPE vt, const char* szCol, char& nValue);
bool ModifyValue(VALUE_TYPE vt, const char* szCol, DWORD& nValue);
bool ModifyValue(VALUE_TYPE vt, const char* szCol, WORD& nValue);
bool ModifyValue(VALUE_TYPE vt, const char* szCol, BYTE& nValue);
bool ModifyValue(VALUE_TYPE vt, const char* szCol, char* nValue, int Size);
bool ModifyValue(VALUE_TYPE vt, const char* szCol, WCHAR* nValue, int Size);
bool ModifyValue(VALUE_TYPE vt, const char* szCol, WCHAR& nValue);
bool ModifyValue(VALUE_TYPE vt, const char* szCol, bool& nValue);
std::wstring ConvertSQLString(WCHAR* sz);
std::string ConvertSQLString(char* sz);
private:
CSqlLibHandler m_slqdb;
};