BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
UniConnection.h
Go to the documentation of this file.
1// -------------------------------------------------------------------------
2// ----- UniConnection header file -----
3// -------------------------------------------------------------------------
4
5/** UniConnection.h
6 *@author K.Gertsenberger <gertsen@jinr.ru>
7 **
8 ** Class for connection to the experiment database: Unified Condition Database
9 **/
10
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
44
45 static const char* DbToString() { return "UNIFIED_DB"; }
46
47 protected:
49
50 private:
52
54 static UniConnection* OpenConnection(const TString& connect_string,
55 const char* strDBHost,
56 const char* strUID,
57 const char* strPassword);
58
60};
61
62#endif
#define ClassDef(name, id)
TSQLServer * db_server
static UniConnection * OpenConnection(const TString &connect_string, const char *strDBHost, const char *strUID, const char *strPassword)
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()
UniConnection(TSQLServer *pSQLServer)
virtual ~UniConnection()
map< string, TSQLServer * > mapSQLServer
map< string, TSQLServer * >::iterator itSQLServer
pair< string, TSQLServer * > pairSQLServer
Definition json.hpp:4446