Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
17namespace oracle {
18namespace occi {
19 class Environment;
20 class Connection;
21}
22}
23
24class TOracleServer : public TSQLServer {
25
26private:
27 oracle::occi::Environment *fEnv{nullptr}; // environment of Oracle access
28 oracle::occi::Connection *fConn{nullptr}; // connection to Oracle server
29 TString fInfo; // info string with Oracle version information
30
31 static const char* fgDatimeFormat; //! format for converting date and time stamps into string
32
33 TOracleServer(const TOracleServer&) = delete;
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 && fEnv; }
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:45
bool Bool_t
Definition RtypesCore.h:63
const Bool_t kTRUE
Definition RtypesCore.h:100
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:329
A doubly linked list.
Definition TList.h:38
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
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.
TOracleServer & operator=(const TOracleServer &)=delete
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
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
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
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
Bool_t IsConnected() const final
Int_t Reload() final
Reload permission tables.
Int_t SelectDataBase(const char *dbname) final
Select a database.
TOracleServer(const TOracleServer &)=delete
format for converting date and time stamps into string
Basic string class.
Definition TString.h:136