00001
00002
00003
00004
00005
00006
00007
00008
00015 #ifndef zz_db_pool_h
00016 #define zz_db_pool_h
00017
00018 #include <zz_string.h>
00019 #include <zz_db.h>
00020 #include <zz_db_exception.h>
00021 #include <map>
00022
00023 class ZZ_API CzzDbPool
00024 {
00025 public:
00026
00027
00028 CzzDbPool( const char* connect, int size, int autocommit = 1 );
00029 virtual ~CzzDbPool();
00030
00031 CzzDb* getConnection( void );
00032 void freeConnection( CzzDb* connection );
00033
00034 protected:
00035 private:
00036 CzzLog m_Log;
00037 CzzString m_Connect;
00038 int m_Size;
00039 map<int, CzzDb* > m_Pool;
00040 map<int, bool > m_Locktable;
00041 static CzzWinThreadMutex m_Mutex;
00042 };
00043
00044 #endif // zz_db_pool_h