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#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
26namespace oracle { namespace occi {
27class Environment;
28class Connection;
29}}
30#endif
31
32
33class TOracleServer : public TSQLServer {
34
35private:
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
42public:
43 TOracleServer(const char *db, const char *uid, const char *pw);
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);
59 Int_t CreateDataBase(const char *dbname);
60 Int_t DropDataBase(const char *dbname);
61 Int_t Reload();
63 const char *ServerInfo();
64
66 Bool_t Commit();
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
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kTRUE
Definition: RtypesCore.h:87
const char Option_t
Definition: RtypesCore.h:62
#define ClassDef(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,...
Int_t GetMaxIdentifierLength()
Definition: TOracleServer.h:58
oracle::occi::Connection * fConn
Definition: TOracleServer.h:37
Int_t Reload()
Reload permission tables.
TSQLStatement * Statement(const char *sql, Int_t niter=100)
TSQLResult * Query(const char *sql)
Execute SQL command.
TSQLTableInfo * GetTableInfo(const char *tablename)
Produces SQL table info Object must be deleted by user.
Int_t CreateDataBase(const char *dbname)
Create a database.
void Close(Option_t *opt="")
Close connection to Oracle DB server.
Bool_t Exec(const char *sql)
Execute sql command wich does not produce any result set.
static const char * fgDatimeFormat
Definition: TOracleServer.h:40
~TOracleServer()
Close connection to Oracle DB server.
const char * ServerInfo()
Return Oracle server version info.
Int_t DropDataBase(const char *dbname)
Drop (i.e.
TSQLResult * GetTables(const char *dbname, const char *wild=0)
List all tables in the specified database.
TSQLResult * GetDataBases(const char *wild=0)
List all available databases.
TSQLResult * GetColumns(const char *dbname, const char *table, const char *wild=0)
List all columns in specified table in the specified database.
Bool_t StartTransaction()
Call Commit() to submit all chanes, done before.
Bool_t HasStatement() const
Definition: TOracleServer.h:51
static const char * GetDatimeFormat()
return value of actul convertion format from timestamps or date to string
oracle::occi::Environment * fEnv
Definition: TOracleServer.h:36
Bool_t Commit()
Commits all changes made since the previous Commit() or Rollback() Return kTRUE if OK.
Int_t SelectDataBase(const char *dbname)
Select a database.
TOracleServer(const char *db, const char *uid, const char *pw)
format for converting date and time stamps into string
TList * GetTablesList(const char *wild=0)
Return list of user tables Parameter wild specifies wildcard for table names.
Bool_t IsConnected() const
Definition: TOracleServer.h:50
Int_t Shutdown()
Shutdown the database server.
Bool_t Rollback()
Drops all changes made since the previous Commit() or Rollback() Return kTRUE if OK.
Basic string class.
Definition: TString.h:131