久久精品人人爽,华人av在线,亚洲性视频网站,欧美专区一二三

嵌入式MYSQL服務器的實現方法

145次閱讀
沒有評論

共計 3083 個字符,預計需要花費 8 分鐘才能閱讀完成。

這篇文章主要介紹“嵌入式 MYSQL 服務器的實現方法”,在日常操作中,相信很多人在嵌入式 MYSQL 服務器的實現方法問題上存在疑惑,丸趣 TV 小編查閱了各式資料,整理出簡單好用的操作方法,希望對大家解答”嵌入式 MYSQL 服務器的實現方法”的疑惑有所幫助!接下來,請跟著丸趣 TV 小編一起來學習吧!

 
// 嵌入式 MYSQL 服務器

class CEmbeddedMySQL 
public:
 CEmbeddedMySQL();
 virtual ~CEmbeddedMySQL();
 
 static bool StartupEmbeddedServer();
 static void ShutdownEmbeddedServer();
 
 bool Open( const string  svr, const string  usr, const string  pwd, const string  db);
 void Close();
 bool ResetDB();
 void Set( const string  sField, const string  sValue );
 void Set( const string  sField, double dValue );
 void Set( const string  sField, long nValue );
 void Set( const string  sField, int nValue );
 void Set( const string  sField, BYTE *pBuf, int nLen );
 void SetNull( const string  sField );
 void registerOutParameter( const string  sField, char cType );
// void SetRecord( const string  sField, const string  sTableName, const string  sTypeName, CStdRecord  Record );
 
 void Cmd(const char *cmd,...);
 bool More();
 long Exec();
// bool SelectInto(CStdRecord *pRecord,bool bCreateHead=true); 
 
 double GetDouble(int id);
 double GetDouble(const string  name);
 long GetLong(int id);
 long GetLong(const string  name);
 string Get(int id);
 string Get(const string  name);
 string GetLastErrMsg();
 char* GetSql();
 
 bool MoreForUpdate();
 bool SetBuffer( int nFieldIndex, BYTE *pBuf, long nSize );
 bool SetBuffer( const string  sField, BYTE *pBuf, long nSize );
 bool GetBuffer( const string  sField, BYTE *pBuf, long  nSize );
 bool GetBuffer( int nFieldIndex, BYTE *pBuf, long  nSize );
 long GetDataSize( const string  sField );
 long GetDataSize( int nFieldIndex );
 long GetActualSize( const string  sField );
 long GetActualSize( int nFieldIndex );
 void ClearSql();
 long GetColIndex( const string  sField );
 string GetColName( int nFiledIndex );
 string GetColType( int index );
 int GetNumCols();
 string GetHeadScript();
 
 int row_getsize();
 bool row_gethead( string  sHead );
 bool row_more( char *pData, int  nSize ); 
 
 void SetAutoCommit( bool autoCommit );
 void RollBack();
 void Commit();
 bool IsDead();
 bool SetParam( int nType, const string  sVal );
protected:
 void WriteSQLErrLog();
 
 //  獲取過程返回值
 string GetStorageProReturnValue(const string  name);
 void CopyRowData(char * pData,MYSQL_ROW row); // added by cailei
 CStdString GetCurTime(time_t nTime=0);
 long GetCurDate(time_t nTime=0);
 MYSQL *m_hMySQL;
 MYSQL_RES *m_pRes;
 MYSQL_ROW m_Row;
 MYSQL_FIELD *m_pFields;
 long m_nRowSize;
 
 bool m_bRegParam; //  是否注冊了過程返回變量
 
protected:
 string m_sSvr;
 string m_sUser;
 string m_sPwd;
 string m_sDB;
 string m_sUserMode;
 bool m_bReopen; // 是系統重新打開連接
 
 int m_nStatus; // 0 :SQL  空閑狀態  1 : 有 SQL 語句等待執行  2: 有結果數據待取出  
 int m_nCount; // 結果集記錄數量
 int m_nCode; // 執行返回碼
 int m_nSQLSize; // 默認是 16K
 string m_sErr; // 錯誤消息
 char *m_pSQL; //SQL 語句
 string m_sSrc; // 調用源
 bool m_bError; // 語句執行是否出錯
 int m_nDBType; // 驅動類型
 void *m_pUniDBRecv; // 保留
 bool m_bTran; // 事務標志
 void *m_pReq; www.2cto.com 
 byte *m_pReqBuf;
 int m_nReqSize;
 bool m_bDebug;
#endif // !defined(AFX_EMBEDDEDMYSQL_H__516724E2_889C_4899_9DAE_330CD4C5954F__INCLUDED_)

到此,關于“嵌入式 MYSQL 服務器的實現方法”的學習就結束了,希望能夠解決大家的疑惑。理論與實踐的搭配能更好的幫助大家學習,快去試試吧!若想繼續學習更多相關知識,請繼續關注丸趣 TV 網站,丸趣 TV 小編會繼續努力為大家帶來更多實用的文章!

正文完
 
丸趣
版權聲明:本站原創文章,由 丸趣 2023-07-28發表,共計3083字。
轉載說明:除特殊說明外本站除技術相關以外文章皆由網絡搜集發布,轉載請注明出處。
評論(沒有評論)
主站蜘蛛池模板: 合作市| 龙州县| 聂荣县| 温泉县| 湖口县| 大理市| 都安| 双柏县| 涟源市| 抚远县| 肃宁县| 海兴县| 潞西市| 朝阳区| 团风县| 临洮县| 郎溪县| 郁南县| 游戏| 东丰县| 涟源市| 天柱县| 宜兰县| 高淳县| 于都县| 尼玛县| 惠来县| 宁都县| 七台河市| 东兰县| 湘阴县| 柳江县| 吉安县| 西充县| 韩城市| 广河县| 阳春市| 新乐市| 大方县| 友谊县| 怀柔区|