Logo ROOT   6.08/07
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 #ifndef ROOT_TSQLServer
16 #include "TSQLServer.h"
17 #endif
18 
19 #if !defined(__CINT__)
20 #ifndef R__WIN32
21 #include <sys/time.h>
22 #endif
23 #include <occi.h>
24 #ifdef CONST
25 #undef CONST
26 #endif
27 #else
28 namespace oracle { namespace occi {
29 class Environment;
30 class Connection;
31 }}
32 #endif
33 
34 
35 class TOracleServer : public TSQLServer {
36 
37 private:
38  oracle::occi::Environment *fEnv; // environment of Oracle access
39  oracle::occi::Connection *fConn; // connection to Oracle server
40  TString fInfo; // info string with Oracle version information
41 
42  static const char* fgDatimeFormat; //! format for converting date and time stamps into string
43 
44 public:
45  TOracleServer(const char *db, const char *uid, const char *pw);
46  ~TOracleServer();
47 
48  void Close(Option_t *opt="");
49  TSQLResult *Query(const char *sql);
50  Bool_t Exec(const char* sql);
51  TSQLStatement *Statement(const char *sql, Int_t niter = 100);
52  Bool_t IsConnected() const { return (fConn!=0) && (fEnv!=0); }
53  Bool_t HasStatement() const { return kTRUE; }
54  Int_t SelectDataBase(const char *dbname);
55  TSQLResult *GetDataBases(const char *wild = 0);
56  TSQLResult *GetTables(const char *dbname, const char *wild = 0);
57  TList *GetTablesList(const char* wild = 0);
58  TSQLTableInfo *GetTableInfo(const char* tablename);
59  TSQLResult *GetColumns(const char *dbname, const char *table, const char *wild = 0);
60  Int_t GetMaxIdentifierLength() { return 30; }
61  Int_t CreateDataBase(const char *dbname);
62  Int_t DropDataBase(const char *dbname);
63  Int_t Reload();
64  Int_t Shutdown();
65  const char *ServerInfo();
66 
67  Bool_t StartTransaction();
68  Bool_t Commit();
69  Bool_t Rollback();
70 
71  static void SetDatimeFormat(const char* fmt = "MM/DD/YYYY, HH24:MI:SS");
72  static const char* GetDatimeFormat();
73 
74  ClassDef(TOracleServer,0) // Connection to Oracle server
75 };
76 
77 #endif
Bool_t HasStatement() const
Definition: TOracleServer.h:53
const char Option_t
Definition: RtypesCore.h:62
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
oracle::occi::Environment * fEnv
Definition: TOracleServer.h:38
#define ClassDef(name, id)
Definition: Rtypes.h:254
oracle::occi::Connection * fConn
Definition: TOracleServer.h:39
A doubly linked list.
Definition: TList.h:47
Int_t GetMaxIdentifierLength()
Definition: TOracleServer.h:60
static const char * fgDatimeFormat
Definition: TOracleServer.h:42
Bool_t IsConnected() const
Definition: TOracleServer.h:52
const Bool_t kTRUE
Definition: Rtypes.h:91