| 1234567891011121314151617181920212223242526 |
- // DBInterface.cpp : Defines the entry point for the DLL application.
- //
- #include "stdafx.h"
- #include "DBInterface.h"
- DWORD InItDBConnPool(LPCSTR strDstAddress, LPCSTR strUsername, LPCSTR strPassword, LPCSTR strDBName,int minConn,int maxConn)
- {
- DBConnPool::Instanse()->SetDBInfo(strDstAddress,strUsername,strPassword,strDBName,minConn,maxConn);
- return DBConnPool::Instanse()->InitializeAllDBConnections();
- }
- //数据库接口。下面2个是具体的例子,和自己的使用情况相关,
- void GetSubmitInfo(vector<SOAP_SUBMIT_SMS> &vecsoapSms)
- {
- DBConnect *pDBConn = NULL;
- DBConnGuard oConnGuard(pDBConn);
- //此处为实际实现的接口,自己需要实现。
- pDBConn->GetSubmitInfo(vecsoapSms);
- }
- void InsertHistory(int id)
- {
- DBConnect *pDBConn = NULL;
- DBConnGuard oConnGuard(pDBConn);
- pDBConn->InsertHistory(id);
- }
|