Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
S3PDBConnectionPool.h
Package: SwordOnline.rar [view]
Upload User: dzyhzl
Upload Date: 2019-04-29
Package Size: 56270k
Code Size: 2k
Category:
Game Server Simulator
Development Platform:
C/C++
- //-----------------------------------------//
- // //
- // File : S3PDBConnectionPool.h //
- // Author : Yang Xiaodong //
- // Modified : 8/24/2002 //
- // //
- //-----------------------------------------//
- #ifndef _S3PDBCONNECTIONPOOL_H_
- #define _S3PDBCONNECTIONPOOL_H_
- #include "KStdAfx.h"
- #include <sqlplus.hh>
- #include <custom.hh>
- #include <string>
- #include <map>
- #define def_ERRORCONID 0xffffffff
- typedef struct tag_CONNECTION_ID
- {
- DWORD dwID;
- Connection* pCon;
- }_CONNECTION_ID, * _LPCONNECTION_ID;
- class S3PDBConnectionPool
- {
- typedef struct tag_DATABASEINFO
- {
- std::string strServer;
- std::string strDataBase;
- std::string strUser;
- std::string strPassword;
- }_DATABASEINFO, *_LPDATABASEINFO;
- typedef struct tag_CONNECTIONITEM
- {
- BOOL bBusy;
- Connection* pCon;
- }_CONNECTIONITEM, *_LPCONNECTIONITEM;
- typedef std::map< DWORD, _CONNECTIONITEM > ConMap;
- // Static members
- //------>BEGIN
- public:
- static void Init( const std::string &strINIPath );
- static S3PDBConnectionPool* Instance();
- static void ReleaseInstance();
- protected:
- static void InitAccountDBInfo();
- static void InitRoleDBInfo();
- static void InitCardDBInfo();
- static S3PDBConnectionPool* m_pInstance;
- static std::string m_strINIPath;
- static _DATABASEINFO m_AccountDBInfo;
- static _DATABASEINFO m_RoleDBInfo;
- static _DATABASEINFO m_CardDBInfo;
- //<------END
- public:
- virtual _CONNECTION_ID ApplyDBConnection( int iDBIdentifier );
- virtual BOOL SetDBConFree( int iDBIdentifier, DWORD dwConID );
- protected:
- S3PDBConnectionPool();
- virtual ~S3PDBConnectionPool();
- virtual _CONNECTION_ID ApplyAccountDBCon();
- virtual _CONNECTION_ID ApplyRoleDBCon();
- virtual _CONNECTION_ID ApplyCardDBCon();
- virtual BOOL SetAccountDBConFree( DWORD dwConID );
- virtual BOOL SetRoleDBConFree( DWORD dwConID );
- virtual BOOL SetCardDBConFree( DWORD dwConID );
- virtual void ReleaseAccountMap();
- virtual void ReleaseRoleMap();
- virtual void ReleaseCardMap();
- virtual void Release();
- protected:
- ConMap m_AccountMap;
- ConMap m_RoleMap;
- ConMap m_CardMap;
- };
- #endif // _S3PDBCONNECTIONPOOL_H_