Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TSQLConnection.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TSQLConnection.h
1 // $Id: TSQLConnection.h,v 1.1.1.1 2004/02/18 20:58:02 dave Exp $
2 
3 #ifndef RDBC_TSQLConnection_h
4 #define RDBC_TSQLConnection_h
5 
6 //
7 // TSQLConnection - connection to DataBase
8 //
9 
10 #ifndef RDBC_TSQL_h
11 #include <RDBC/TSQL.h>
12 #endif
13 #ifndef ROOT_TObject
14 #include "TObject.h"
15 #endif
16 #ifndef ROOT_TRefCnt
17 #include "TRefCnt.h"
18 #endif
19 
20 class TSQLStatement;
23 class TSQLDriverManager;
25 class TList;
26 
34 };
35 
37 class TSQLConnection: public TObject, public TSQL, public TRefCnt
38 {
39 friend class TSQLDriverManager;
40 
41 protected:
42  TSQLDatabaseMetaData* fMetaData; // database metadata
43  TList* fListOfStatements; // list of SQL statemens
44 
45  TSQLConnection( const TString& url, const TString& username,
46  const TString& password );
47  TSQLConnection( const TString& connectString );
48 
49  void SetURL(const TString& url);
50  virtual ~TSQLConnection();
51 
52 public:
53  virtual Bool_t GetAutoCommit() = 0;
54  virtual void SetAutoCommit( Bool_t autoCommit = kTRUE ) = 0;
55  virtual TString GetCatalog() = 0;
56  virtual void SetCatalog( const TString& catalog ) = 0;
57  virtual Bool_t IsClosed();
58  virtual Bool_t IsReadOnly() = 0;
59  virtual void SetReadOnly( Bool_t readOnly = kTRUE ) = 0;
60  virtual Bool_t GetTrace() = 0;
61  virtual void SetTrace( Bool_t trace = kTRUE ) = 0;
62  virtual void SetTraceFile( const TString& filename ) = 0;
63  virtual TString GetTraceFile() = 0;
64  virtual Int_t GetTransactionIsolation() = 0;
65  virtual void SetTransactionIsolation( Int_t level ) = 0;
66  virtual TString NativeSQL( const TString& sql ) = 0;
67  virtual void Commit() = 0;
68  virtual void Rollback() = 0;
69  virtual TSQLStatement* CreateStatement() = 0;
70  virtual TSQLStatement* CreateStatement( Int_t resultSetType,
71  Int_t resultSetConcurrency ) = 0;
72  virtual TSQLPreparedStatement* PrepareStatement( const TString& sql ) = 0;
73  virtual TSQLPreparedStatement* PrepareStatement( const TString& sql,
74  Int_t resultSetType,
75  Int_t resultSetConcurrency ) = 0;
76  virtual TSQLCallableStatement* PrepareCall( const TString& sql ) = 0;
77  virtual TSQLCallableStatement* PrepareCall( const TString& sql,
78  Int_t resultSetType,
79  Int_t resultSetConcurrency ) = 0;
80  virtual TSQLDatabaseMetaData* GetMetaData() = 0;
81  virtual Bool_t HasBatchSupport() = 0;
82 
83  virtual void Close();
84  TList* GetListOfStatements() const { return fListOfStatements; }
85  virtual const char *GetName() const;
86  virtual const char *GetTitle() const;
87  virtual void Print(Option_t *option="") const;
88  virtual void ls(Option_t *option="") const { Print(option); }
89 
90 ClassDef(TSQLConnection,0)//A connection to a specific database.
91 };
92 
93 #endif // RDBC_TSQLConnection_h