source: trunk/Mars/msql/MSQLMagic.h@ 15230

Last change on this file since 15230 was 9039, checked in by tbretz, 16 years ago
*** empty log message ***
File size: 1.9 KB
Line 
1#ifndef MARS_MSQLMagic
2#define MARS_MSQLMagic
3
4#ifndef MARS_MSQLServer
5#include "MSQLServer.h"
6#endif
7
8class MSQLMagic : public MSQLServer
9{
10 Bool_t fIsDummy;
11
12public:
13 MSQLMagic(TSQLServer *serv, const char *dbname=0, const char *tname=0, const char *col=0) :
14 MSQLServer(serv, dbname, tname, col), fIsDummy(kFALSE)
15 {
16 }
17
18 MSQLMagic(const char *connection, const char *user, const char *password) :
19 MSQLServer(connection, user, password), fIsDummy(kFALSE)
20 {
21 }
22
23 MSQLMagic(const char *link) : MSQLServer(link), fIsDummy(kFALSE)
24 {
25 }
26
27 MSQLMagic(TEnv &env, const char *prefix=0) :
28 MSQLServer(env, prefix), fIsDummy(kFALSE)
29 {
30 }
31
32 MSQLMagic() : MSQLServer(), fIsDummy(kFALSE)
33 {
34 }
35
36
37 void SetIsDummy(Bool_t dummy=kTRUE) { fIsDummy=dummy; }
38 Bool_t IsDummy() const { return fIsDummy; }
39
40 TString QueryValOf(TString col, const char *ext, const char *key);
41 TString QueryValOfKey(TString col, const char *key);
42 TString QueryNameOfKey(TString col, const char *key);
43 Int_t QueryKeyOfName(const char *col, const char *name, Bool_t insert=kTRUE);
44 Int_t QueryKeyOfVal(const char *col, const char *val);
45 Int_t QueryKeyOf(const char *col, const char *ext, const char *val);
46 Bool_t ExistStr(const char *column, const char *table, const char *test, const char *where=0);
47 Bool_t ExistRow(const char *table, const char *where);
48
49 Int_t Insert(const char *table, const char *vars, const char *where=0);
50 Int_t Update(const char *table, const char *vars, const char *where=0);
51 Int_t Delete(const char *table, const char *where);
52 Int_t InsertUpdate(const char *table, const char *col, const char *val, const char *vars);
53 Int_t InsertUpdate(const char *table, const char *vars, const char *where);
54
55 void Delete(const Option_t *o) { TObject::Delete(o); }
56
57 ClassDef(MSQLMagic, 0) // An enhancement of MSQLServer featuring our database
58};
59
60#endif
Note: See TracBrowser for help on using the repository browser.