37 if (connDb ==
nullptr)
48 if (detector_desc ==
nullptr)
55 cout <<
"ERROR: inserting new detector to the Database has been failed" << endl;
64 tmp_detector_name = detector_name;
66 if (detector_desc ==
nullptr)
67 tmp_detector_desc =
nullptr;
69 tmp_detector_desc =
new TString(*detector_desc);
71 return new UniDetector(connDb, tmp_detector_name, tmp_detector_desc);
78 if (connDb ==
nullptr)
85 "where lower(detector_name) = lower('%s')",
86 detector_name.
Data());
91 cout <<
"ERROR: getting detector from the database has been failed" << endl;
103 cout <<
"ERROR: detector was not found in the database" << endl;
114 tmp_detector_desc =
nullptr;
120 return new UniDetector(connDb, tmp_detector_name, tmp_detector_desc);
127 if (connDb ==
nullptr)
134 "where lower(detector_name) = lower('%s')",
135 detector_name.
Data());
140 cout <<
"ERROR: getting detector from the database has been failed" << endl;
167 if (connDb ==
nullptr)
173 "where lower(detector_name) = lower($1)");
181 cout <<
"ERROR: deleting detector from the dataBase has been failed" << endl;
197 if (connDb ==
nullptr)
208 cout <<
"ERROR: getting all 'detectors' from the dataBase has been failed" << endl;
219 cout <<
"Table 'detector_':" << endl;
221 cout <<
"detector_name: ";
223 cout <<
", detector_desc: ";
241 cout <<
"CRITICAL ERROR: Connection object is null" << endl;
248 "set detector_name = $1 "
249 "where detector_name = $2");
258 cout <<
"ERROR: updating information about detector has been failed" << endl;
273 cout <<
"CRITICAL ERROR: Connection object is null" << endl;
280 "set detector_desc = $1 "
281 "where detector_name = $2");
285 if (detector_desc ==
nullptr)
293 cout <<
"ERROR: updating information about detector has been failed" << endl;
301 if (detector_desc ==
nullptr)
313 cout <<
"Table 'detector_'";
virtual TSQLStatement * Statement(const char *, Int_t=100)
virtual const char * GetString(Int_t)
virtual Bool_t NextIteration()=0
virtual Bool_t NextResultRow()=0
virtual Bool_t SetString(Int_t, const char *, Int_t=256)
virtual Bool_t IsNull(Int_t)
virtual Bool_t Process()=0
virtual Bool_t SetNull(Int_t)
virtual Bool_t StoreResult()=0
const char * Data() const
static TString Format(const char *fmt,...)
static UniConnection * Open()
TSQLServer * GetSQLServer()
void Print()
print information about current detector
int SetDetectorName(TString detector_name)
set detector name of the current detector
TString str_detector_name
detector name
UniDetector(UniConnection *db_connect, TString detector_name, TString *detector_desc)
static int CheckDetectorExists(TString detector_name)
check detector exists in the database: 1- true, 0 - false, <0 - database operation error
TString * str_detector_desc
detector description
static int PrintAll()
print all detectors
static int DeleteDetector(TString detector_name)
delete detector from the database
UniConnection * connectionDB
connection to the database
static UniDetector * CreateDetector(TString detector_name, TString *detector_desc)
add new detector to the database
static UniDetector * GetDetector(TString detector_name)
get detector from the database
int SetDetectorDesc(TString *detector_desc)
set detector description of the current detector