Logo ROOT  
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#ifndef R__WIN32
18#include <sys/time.h>
19#endif
20
21#include <occi.h>
22
23#ifdef CONST
24#undef CONST
25#endif
26
27class TOracleServer : public TSQLServer {
28
29private:
30 oracle::occi::Environment *fEnv{nullptr}; // environment of Oracle access
31 oracle::occi::Connection *fConn{nullptr}; // connection to Oracle server
32 TString fInfo; // info string with Oracle version information
33
34 static const char* fgDatimeFormat; //! format for converting date and time stamps into string
35
36public:
37 TOracleServer(const char *db, const char *uid, const char *pw);
39
40 void Close(Option_t *opt="") final;
41 TSQLResult *Query(const char *sql) final;
42 Bool_t Exec(const char* sql) final;
43 TSQLStatement *Statement(const char *sql, Int_t niter = 100) final;
44 Bool_t IsConnected() const final { return (fConn!=0) && (fEnv!=0); }
45 Bool_t HasStatement() const final { return kTRUE; }
46 Int_t SelectDataBase(const char *dbname) final;
47 TSQLResult *GetDataBases(const char *wild = nullptr) final;
48 TSQLResult *GetTables(const char *dbname, const char *wild = nullptr) final;
49 TList *GetTablesList(const char* wild = nullptr) final;
50 TSQLTableInfo *GetTableInfo(const char* tablename) final;
51 TSQLResult *GetColumns(const char *dbname, const char *table, const char *wild = nullptr) final;
52 Int_t GetMaxIdentifierLength() final { return 30; }
53 Int_t CreateDataBase(const char *dbname) final;
54 Int_t DropDataBase(const char *dbname) final;
55 Int_t Reload() final;
56 Int_t Shutdown() final;
57 const char *ServerInfo() final;
58
60 Bool_t Commit() final;
61 Bool_t Rollback() final;
62
63 static void SetDatimeFormat(const char* fmt = "MM/DD/YYYY, HH24:MI:SS");
64 static const char* GetDatimeFormat();
65
66 ClassDefOverride(TOracleServer,0) // Connection to Oracle server
67};
68
69#endif
int Int_t
Definition: RtypesCore.h:43
bool Bool_t
Definition: RtypesCore.h:61
const Bool_t kTRUE
Definition: RtypesCore.h:89
const char Option_t
Definition: RtypesCore.h:64
#define ClassDefOverride(name, id)
Definition: Rtypes.h:326
A doubly linked list.
Definition: TList.h:44
static void SetDatimeFormat(const char *fmt="MM/DD/YYYY, HH24:MI:SS")
set format for converting timestamps or date field into string default value is "MM/DD/YYYY,...
oracle::occi::Connection * fConn
Definition: TOracleServer.h:31
TSQLResult * GetTables(const char *dbname, const char *wild=nullptr) final
List all tables in the specified database.
Int_t DropDataBase(const char *dbname) final
Drop (i.e.
Int_t Shutdown() final
Shutdown the database server.
TSQLResult * GetColumns(const char *dbname, const char *table, const char *wild=nullptr) final
List all columns in specified table in the specified database.
static const char * fgDatimeFormat
Definition: TOracleServer.h:34
TSQLStatement * Statement(const char *sql, Int_t niter=100) final
Bool_t StartTransaction() final
Call Commit() to submit all chanes, done before.
~TOracleServer()
Close connection to Oracle DB server.
Bool_t Commit() final
Commits all changes made since the previous Commit() or Rollback() Return kTRUE if OK.
void Close(Option_t *opt="") final
Close connection to Oracle DB server.
Bool_t Rollback() final
Drops all changes made since the previous Commit() or Rollback() Return kTRUE if OK.
Bool_t HasStatement() const final
Definition: TOracleServer.h:45
const char * ServerInfo() final
Return Oracle server version info.
TSQLResult * Query(const char *sql) final
Execute SQL command.
Bool_t Exec(const char *sql) final
Execute sql command which does not produce any result set.
TList * GetTablesList(const char *wild=nullptr) final
Return list of user tables Parameter wild specifies wildcard for table names.
TSQLTableInfo * GetTableInfo(const char *tablename) final
Produces SQL table info Object must be deleted by user.
Int_t CreateDataBase(const char *dbname) final
Create a database.
Int_t GetMaxIdentifierLength() final
Definition: TOracleServer.h:52
TSQLResult * GetDataBases(const char *wild=nullptr) final
List all available databases.
static const char * GetDatimeFormat()
return value of actul convertion format from timestamps or date to string
oracle::occi::Environment * fEnv
Definition: TOracleServer.h:30
TOracleServer(const char *db, const char *uid, const char *pw)
format for converting date and time stamps into string
Bool_t IsConnected() const final
Definition: TOracleServer.h:44
Int_t Reload() final
Reload permission tables.
Int_t SelectDataBase(const char *dbname) final
Select a database.
Basic string class.
Definition: TString.h:131