Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TOracleResult.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_TOracleResult
13#define ROOT_TOracleResult
14
15#include "TSQLResult.h"
16
17#include <vector>
18
19namespace oracle {
20namespace occi {
21 class Connection;
22 class Statement;
23 class ResultSet;
24 struct MetaData;
25}
26}
27
28class TList;
29
30class TOracleResult : public TSQLResult {
31
32private:
33 oracle::occi::Connection *fConn{nullptr}; // connection to Oracle
34 oracle::occi::Statement *fStmt{nullptr}; // executed statement
35 oracle::occi::ResultSet *fResult{nullptr}; // query result (rows)
36 std::vector<oracle::occi::MetaData> *fFieldInfo{nullptr}; // info for each field in the row
37 Int_t fFieldCount{0}; // num of fields in resultset
38 UInt_t fUpdateCount{0}; // for dml query, mutual exclusive with above
39 Int_t fResultType{0}; // 0 - nothing; 1 - Select; 2 - table metainfo, 3 - update counter
40 TList *fPool{nullptr}; // array of results, produced when number of rows are requested
41 std::string fNameBuffer; // buffer for GetFieldName() argument
42
43 Bool_t IsValid(Int_t field);
44
45 TOracleResult(const TOracleResult&) = delete;
47
48protected:
49 void initResultSet(oracle::occi::Statement *stmt);
50 void ProducePool();
51
52public:
53 TOracleResult(oracle::occi::Connection *conn, oracle::occi::Statement *stmt);
54 TOracleResult(oracle::occi::Connection *conn, const char *tableName);
56
57 void Close(Option_t *opt="") final;
58 Int_t GetFieldCount() final;
59 const char *GetFieldName(Int_t field) final;
60 Int_t GetRowCount() const final;
61 TSQLRow *Next() final;
62
63 Int_t GetUpdateCount() const { return fUpdateCount; }
64
65 ClassDefOverride(TOracleResult,0) // Oracle query result
66};
67
68#endif
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:329
A doubly linked list.
Definition TList.h:44
UInt_t fUpdateCount
Bool_t IsValid(Int_t field)
Check if result set is open and field index within range.
Int_t GetRowCount() const final
TSQLRow * Next() final
Get next query result row.
oracle::occi::Statement * fStmt
std::vector< oracle::occi::MetaData > * fFieldInfo
TOracleResult & operator=(const TOracleResult &)=delete
TOracleResult(oracle::occi::Connection *conn, const char *tableName)
const char * GetFieldName(Int_t field) final
Get name of specified field.
Int_t GetUpdateCount() const
void initResultSet(oracle::occi::Statement *stmt)
Oracle query result.
void Close(Option_t *opt="") final
Close query result.
~TOracleResult()
Cleanup Oracle query result.
Int_t GetFieldCount() final
Get number of fields in result.
TOracleResult(const TOracleResult &)=delete
oracle::occi::Connection * fConn
TOracleResult(oracle::occi::Connection *conn, oracle::occi::Statement *stmt)
std::string fNameBuffer
oracle::occi::ResultSet * fResult