BmnRoot
Loading...
Searching...
No Matches
UniConnection.h
Go to the documentation of this file.
1// -------------------------------------------------------------------------
2// ----- UniConnection header file -----
3// -------------------------------------------------------------------------
4
11#ifndef UNICONNECTION_H
12#define UNICONNECTION_H 1
13
14#include "uni_db_settings.h"
15
16#include <TSQLServer.h>
17#include <iostream>
18#include <map>
19#include <string>
20using namespace std;
21
22typedef map<string, TSQLServer*> mapSQLServer;
23typedef pair<string, TSQLServer*> pairSQLServer;
24typedef map<string, TSQLServer*>::iterator itSQLServer;
25
26class UniConnection : public TObject
27{
28 public:
30 {
31 MySQL,
32 PgSQL
33 };
34
36 static UniConnection* Open(enumDBMS database_type,
37 const char* strDBHost,
38 const char* strDBName,
39 const char* strUID,
40 const char* strPassword);
41 virtual ~UniConnection(); // Destructor
42
43 TSQLServer* GetSQLServer() { return db_server; }
44
45 static const char* DbToString() { return "UNIFIED_DB"; }
46
47 protected:
49
50 private:
51 TSQLServer* db_server;
52
53 UniConnection(TSQLServer* pSQLServer);
54 static UniConnection* OpenConnection(const TString& connect_string,
55 const char* strDBHost,
56 const char* strUID,
57 const char* strPassword);
58
59 ClassDef(UniConnection, 2)
60};
61
62#endif
static UniConnection * Open()
static const char * DbToString()
static mapSQLServer * mapConnection
static UniConnection * Open(enumDBMS database_type, const char *strDBHost, const char *strDBName, const char *strUID, const char *strPassword)
TSQLServer * GetSQLServer()
virtual ~UniConnection()
map< string, TSQLServer * > mapSQLServer
map< string, TSQLServer * > mapSQLServer
map< string, TSQLServer * >::iterator itSQLServer
pair< string, TSQLServer * > pairSQLServer
STL namespace.