| 1 | #ifndef MARS_MSQLMagic | 
|---|
| 2 | #define MARS_MSQLMagic | 
|---|
| 3 |  | 
|---|
| 4 | #ifndef MARS_MSQLServer | 
|---|
| 5 | #include "MSQLServer.h" | 
|---|
| 6 | #endif | 
|---|
| 7 |  | 
|---|
| 8 | class MSQLMagic : public MSQLServer | 
|---|
| 9 | { | 
|---|
| 10 | Bool_t fIsDummy; | 
|---|
| 11 |  | 
|---|
| 12 | public: | 
|---|
| 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); | 
|---|
| 47 |  | 
|---|
| 48 | Int_t Insert(const char *table, const char *vars); | 
|---|
| 49 | Int_t Update(const char *table, const char *vars, const char *where); | 
|---|
| 50 | Int_t Delete(const char *table, const char *where); | 
|---|
| 51 | Int_t InsertUpdate(const char *table, const char *col, const char *val, const char *vars); | 
|---|
| 52 |  | 
|---|
| 53 | void Delete(const Option_t *o) { TObject::Delete(o); } | 
|---|
| 54 |  | 
|---|
| 55 | ClassDef(MSQLMagic, 0) // An enhancement of MSQLServer featuring our database | 
|---|
| 56 | }; | 
|---|
| 57 |  | 
|---|
| 58 | #endif | 
|---|