Logo ROOT   6.10/09
Reference Guide
TOracleServer.h
Go to the documentation of this file.
1 // @(#)root/physics:$Id$
2 // Author: Yan Liu and Shaowen Wang 23/11/04
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TOracleServer
13 #define ROOT_TOracleServer
14 
15 #include "TSQLServer.h"
16 
17 #if !defined(__CINT__)
18 #ifndef R__WIN32
19 #include <sys/time.h>
20 #endif
21 #include <occi.h>
22 #ifdef CONST
23 #undef CONST
24 #endif
25 #else
26 namespace oracle { namespace occi {
27 class Environment;
28 class Connection;
29 }}
30 #endif
31 
32 
33 class TOracleServer : public TSQLServer {
34 
35 private:
36  oracle::occi::Environment *fEnv; // environment of Oracle access
37  oracle::occi::Connection *fConn; // connection to Oracle server
38  TString fInfo; // info string with Oracle version information
39 
40  static const char* fgDatimeFormat; //! format for converting date and time stamps into string
41 
42 public:
43  TOracleServer(const char *db, const char *uid, const char *pw);
44  ~TOracleServer();
45 
46  void Close(Option_t *opt="");
47  TSQLResult *Query(const char *sql);
48  Bool_t Exec(const char* sql);
49  TSQLStatement *Statement(const char *sql, Int_t niter = 100);
50  Bool_t IsConnected() const { return (fConn!=0) && (fEnv!=0); }
51  Bool_t HasStatement() const { return kTRUE; }
52  Int_t SelectDataBase(const char *dbname);
53  TSQLResult *GetDataBases(const char *wild = 0);
54  TSQLResult *GetTables(const char *dbname, const char *wild = 0);
55  TList *GetTablesList(const char* wild = 0);
56  TSQLTableInfo *GetTableInfo(const char* tablename);
57  TSQLResult *GetColumns(const char *dbname, const char *table, const char *wild = 0);
58  Int_t GetMaxIdentifierLength() { return 30; }
59  Int_t CreateDataBase(const char *dbname);
60  Int_t DropDataBase(const char *dbname);
61  Int_t Reload();
62  Int_t Shutdown();
63  const char *ServerInfo();
64 
65  Bool_t StartTransaction();
66  Bool_t Commit();
67  Bool_t Rollback();
68 
69  static void SetDatimeFormat(const char* fmt = "MM/DD/YYYY, HH24:MI:SS");
70  static const char* GetDatimeFormat();
71 
72  ClassDef(TOracleServer,0) // Connection to Oracle server
73 };
74 
75 #endif
Bool_t HasStatement() const
Definition: TOracleServer.h:51
const char Option_t
Definition: RtypesCore.h:62
Basic string class.
Definition: TString.h:129
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
oracle::occi::Environment * fEnv
Definition: TOracleServer.h:36
#define ClassDef(name, id)
Definition: Rtypes.h:297
oracle::occi::Connection * fConn
Definition: TOracleServer.h:37
A doubly linked list.
Definition: TList.h:43
Int_t GetMaxIdentifierLength()
Definition: TOracleServer.h:58
static const char * fgDatimeFormat
Definition: TOracleServer.h:40
Bool_t IsConnected() const
Definition: TOracleServer.h:50
const Bool_t kTRUE
Definition: RtypesCore.h:91