connectionpool.h

来自「动态连接ODBC数据库.使用通过数据源的名称动态链接访问ODBC数据库」· C头文件 代码 · 共 32 行

H
32
字号

#ifndef _CConnectionPool_H
#define _CConnectionPool_H


#include "DBConnection.h"

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Class   :CConnectionPool
// Purpose : Helds a structure of all connections that can be established to the database.
// Comment : see  ConnectionPool.cpp for implementation of this class.
class CConnectionPool
{
public:
	CConnectionPool();
	~CConnectionPool();

	void AddConnection(CDBConnection *DBCon);
	BOOL AddConnection(CString DSN,CString sUser,CString sPassword,BOOL UseLogonDlg);
	CDBConnection *GetConnection(CString sDSN);
	CDBConnection *GetConnection(int index);
	int GetNumConnections();

protected:
	// A table that helds all connections to the database.
	CTypedPtrArray<CObArray, CDBConnection*> m_pConnections;
private:


};

#endif // _CConnectionPool_H

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?