/search.css" rel="stylesheet" type="text/css"/> /search.js">
00001 #ifndef DBISTATEMENT 00002 #define DBISTATEMENT 00003 00004 00008 00032 #include <list> 00033 00034 #include "TList.h" 00035 #include "TString.h" 00036 #include "TSQLStatement.h" 00037 00038 #include "DatabaseInterface/Dbi.h" 00039 #include "DatabaseInterface/DbiExceptionLog.h" 00040 #include "DatabaseInterface/DbiConnection.h" 00041 00042 class DbiException; 00043 00044 class DbiStatement 00045 { 00046 00047 public: 00048 00049 // Constructors and destructors. 00050 DbiStatement(DbiConnection& conDb); 00051 virtual ~DbiStatement(); 00052 00053 // State testing member functions 00054 00055 Dbi::DbTypes GetDBType() const { return fDbType; } 00056 00057 // Exception log handling. 00058 00062 Bool_t PrintExceptions(Int_t level = 3) const; 00063 00064 const DbiExceptionLog& GetExceptionLog() const { return fExceptionLog; } 00065 00066 // State changing member functions 00067 00069 std::list<TString> TestTranslateSQL(const TString& sql, Dbi::DbTypes type); 00070 00071 // Database I/O 00072 00074 TSQLStatement* ExecuteQuery(const TString& sql=""); 00075 00077 Bool_t ExecuteUpdate( const TString& sql=""); 00078 00080 Bool_t IsLocking(); 00081 00082 00083 private: 00084 00085 void AppendExceptionLog(DbiException* e) { if ( e ) fExceptionLog.AddEntry(*e); } 00086 void AppendExceptionLog(TSQLStatement* s) { if ( s ) fExceptionLog.AddEntry(*s); } 00087 void AppendExceptionLog(DbiConnection& c) { fExceptionLog.AddLog(c.GetExceptionLog()); } 00088 void ClearExceptionLog() { fExceptionLog.Clear(); } 00089 00090 TSQLStatement* CreateProcessedStatement(const TString& sql=""); 00091 std::list<TString> TranslateSQL(const TString& sql); 00092 00093 // Data members 00094 00096 DbiConnection& fConDb; 00097 00099 Dbi::DbTypes fDbType; 00100 00103 DbiExceptionLog fExceptionLog; 00104 00105 // Removed: ClassDef(DbiStatement,0) // Managed TSQL_Statement 00106 00107 }; 00108 00109 00110 #endif // DBISTATEMENT 00111