DBInterface.cpp 791 B

1234567891011121314151617181920212223242526
  1. // DBInterface.cpp : Defines the entry point for the DLL application.
  2. //
  3. #include "stdafx.h"
  4. #include "DBInterface.h"
  5. DWORD InItDBConnPool(LPCSTR strDstAddress, LPCSTR strUsername, LPCSTR strPassword, LPCSTR strDBName,int minConn,int maxConn)
  6. {
  7. DBConnPool::Instanse()->SetDBInfo(strDstAddress,strUsername,strPassword,strDBName,minConn,maxConn);
  8. return DBConnPool::Instanse()->InitializeAllDBConnections();
  9. }
  10. //数据库接口。下面2个是具体的例子,和自己的使用情况相关,
  11. void GetSubmitInfo(vector<SOAP_SUBMIT_SMS> &vecsoapSms)
  12. {
  13. DBConnect *pDBConn = NULL;
  14. DBConnGuard oConnGuard(pDBConn);
  15. //此处为实际实现的接口,自己需要实现。
  16. pDBConn->GetSubmitInfo(vecsoapSms);
  17. }
  18. void InsertHistory(int id)
  19. {
  20. DBConnect *pDBConn = NULL;
  21. DBConnGuard oConnGuard(pDBConn);
  22. pDBConn->InsertHistory(id);
  23. }