FEDRA emulsion software from the OPERA Collaboration
TOracleResult.h
Go to the documentation of this file.
1// @(#)root/physics:$Name: not supported by cvs2svn $:$Id: TOracleResult.h,v 1.2 2007-08-31 12:14:00 valeri Exp $
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 <vector>
16
17#ifndef ROOT_TSQLResult
18#include "TSQLResult.h"
19#endif
20
21#if !defined(__CINT__)
22#ifndef R__WIN32
23#include <sys/time.h>
24#endif
25#include <occi.h>
26using namespace oracle::occi;
27#else
28class Connection;
29class Statement;
30class ResultSet;
31class MetaData;
32#endif
33
34
35class TOracleResult : public TSQLResult {
36
37private:
38 Statement *fStmt;
39 ResultSet *fResult; // query result (rows)
40 std::vector<MetaData> *fFieldInfo; // info for each field in the row
41 Int_t fFieldCount; // num of fields in resultset
42 UInt_t fUpdateCount; // for dml query, mutual exclusive with above
43 Int_t fResultType; // 0 - Update(dml); 1 - Select; -1 - empty
44
45 Bool_t IsValid(Int_t field);
46
47protected:
48 void initResultSet(Statement *stmt);
50
51public:
52 TOracleResult(Statement *stmt);
53 TOracleResult(Statement *stmt, int row_count);
54 TOracleResult(Connection *conn, const char *tableName);
56
57 void Close(Option_t *opt="");
58 Int_t GetFieldCount();
59 const char *GetFieldName(Int_t field);
60 TSQLRow *Next();
61
62 ClassDef(TOracleResult,0) // Oracle query result
63};
64
65#endif
Definition: TOracleResult.h:35
UInt_t fUpdateCount
Definition: TOracleResult.h:42
Bool_t IsValid(Int_t field)
Definition: TOracleResult.cxx:132
TSQLRow * Next()
Definition: TOracleResult.cxx:163
TOracleResult(Statement *stmt)
Definition: TOracleResult.cxx:76
Statement * fStmt
Definition: TOracleResult.h:38
void GetMetaDataInfo()
std::vector< MetaData > * fFieldInfo
Definition: TOracleResult.h:40
ResultSet * fResult
Definition: TOracleResult.h:39
~TOracleResult()
Definition: TOracleResult.cxx:108
const char * GetFieldName(Int_t field)
Definition: TOracleResult.cxx:152
Int_t fResultType
Definition: TOracleResult.h:43
Int_t GetFieldCount()
Definition: TOracleResult.cxx:144
void initResultSet(Statement *stmt)
Definition: TOracleResult.cxx:42
void Close(Option_t *opt="")
Definition: TOracleResult.cxx:117
Int_t fFieldCount
Definition: TOracleResult.h:41
const char * opt
Definition: mc2raw.cxx:42