ROOT logo
// @(#)root/physics:$Id: TOracleServer.h 29321 2009-07-03 10:42:10Z brun $
// Author: Yan Liu and Shaowen Wang   23/11/04

/*************************************************************************
 * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TOracleServer
#define ROOT_TOracleServer

#ifndef ROOT_TSQLServer
#include "TSQLServer.h"
#endif

#if !defined(__CINT__)
#ifndef R__WIN32
#include <sys/time.h>
#endif
#include <occi.h>
using namespace std;
using namespace oracle::occi;
#ifdef CONST
#undef CONST
#endif
#else
class Environment;
class Connection;
#endif


class TOracleServer : public TSQLServer {

private:
   Environment  *fEnv;    // environment of Oracle access
   Connection   *fConn;   // connection to Oracle server
   TString       fInfo;  // info string with Oracle version information
   
   static const char* fgDatimeFormat; //! format for converting date and time stamps into string 

public:
   TOracleServer(const char *db, const char *uid, const char *pw);
   ~TOracleServer();

   void        Close(Option_t *opt="");
   TSQLResult *Query(const char *sql);
   Bool_t      Exec(const char* sql);
   TSQLStatement *Statement(const char *sql, Int_t niter = 100);
   Bool_t      IsConnected() const { return (fConn!=0) && (fEnv!=0); }
   Bool_t      HasStatement() const { return kTRUE; }
   Int_t       SelectDataBase(const char *dbname);
   TSQLResult *GetDataBases(const char *wild = 0);
   TSQLResult *GetTables(const char *dbname, const char *wild = 0);
   TList      *GetTablesList(const char* wild = 0);
   TSQLTableInfo *GetTableInfo(const char* tablename);
   TSQLResult *GetColumns(const char *dbname, const char *table, const char *wild = 0);
   Int_t       GetMaxIdentifierLength() { return 30; }
   Int_t       CreateDataBase(const char *dbname);
   Int_t       DropDataBase(const char *dbname);
   Int_t       Reload();
   Int_t       Shutdown();
   const char *ServerInfo();

   Bool_t      StartTransaction();
   Bool_t      Commit();
   Bool_t      Rollback();

   static    void     SetDatimeFormat(const char* fmt = "MM/DD/YYYY, HH24:MI:SS");
   static const char* GetDatimeFormat();

   ClassDef(TOracleServer,0)  // Connection to Oracle server
};

#endif
 TOracleServer.h:1
 TOracleServer.h:2
 TOracleServer.h:3
 TOracleServer.h:4
 TOracleServer.h:5
 TOracleServer.h:6
 TOracleServer.h:7
 TOracleServer.h:8
 TOracleServer.h:9
 TOracleServer.h:10
 TOracleServer.h:11
 TOracleServer.h:12
 TOracleServer.h:13
 TOracleServer.h:14
 TOracleServer.h:15
 TOracleServer.h:16
 TOracleServer.h:17
 TOracleServer.h:18
 TOracleServer.h:19
 TOracleServer.h:20
 TOracleServer.h:21
 TOracleServer.h:22
 TOracleServer.h:23
 TOracleServer.h:24
 TOracleServer.h:25
 TOracleServer.h:26
 TOracleServer.h:27
 TOracleServer.h:28
 TOracleServer.h:29
 TOracleServer.h:30
 TOracleServer.h:31
 TOracleServer.h:32
 TOracleServer.h:33
 TOracleServer.h:34
 TOracleServer.h:35
 TOracleServer.h:36
 TOracleServer.h:37
 TOracleServer.h:38
 TOracleServer.h:39
 TOracleServer.h:40
 TOracleServer.h:41
 TOracleServer.h:42
 TOracleServer.h:43
 TOracleServer.h:44
 TOracleServer.h:45
 TOracleServer.h:46
 TOracleServer.h:47
 TOracleServer.h:48
 TOracleServer.h:49
 TOracleServer.h:50
 TOracleServer.h:51
 TOracleServer.h:52
 TOracleServer.h:53
 TOracleServer.h:54
 TOracleServer.h:55
 TOracleServer.h:56
 TOracleServer.h:57
 TOracleServer.h:58
 TOracleServer.h:59
 TOracleServer.h:60
 TOracleServer.h:61
 TOracleServer.h:62
 TOracleServer.h:63
 TOracleServer.h:64
 TOracleServer.h:65
 TOracleServer.h:66
 TOracleServer.h:67
 TOracleServer.h:68
 TOracleServer.h:69
 TOracleServer.h:70
 TOracleServer.h:71
 TOracleServer.h:72
 TOracleServer.h:73
 TOracleServer.h:74
 TOracleServer.h:75
 TOracleServer.h:76
 TOracleServer.h:77