Logo ROOT  
Reference Guide
TODBCRow.h
Go to the documentation of this file.
1// @(#)root/odbc:$Id$
2// Author: Sergey Linev 6/02/2006
3
4/*************************************************************************
5 * Copyright (C) 1995-2006, 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_TODBCRow
13#define ROOT_TODBCRow
14
15#include "TSQLRow.h"
16
17#include "TString.h"
18
19#ifdef __CLING__
20typedef void * SQLHSTMT;
21#else
22#ifdef WIN32
23#include "windows.h"
24#endif
25#include <sql.h>
26#endif
27
28class TODBCRow : public TSQLRow {
29
30protected:
31 SQLHSTMT fHstmt;
33 char **fBuffer{nullptr};
34 ULong_t *fLengths{nullptr};
35
36 void CopyFieldValue(Int_t field);
37
38private:
39 TODBCRow(const TODBCRow&) = delete;
40 TODBCRow &operator=(const TODBCRow&) = delete;
41
42public:
43 TODBCRow(SQLHSTMT stmt, Int_t fieldcount);
44 virtual ~TODBCRow();
45
46 void Close(Option_t *opt="") final;
47 ULong_t GetFieldLength(Int_t field) final;
48 const char *GetField(Int_t field) final;
49
50 ClassDefOverride(TODBCRow,0) // One row of ODBC query result
51};
52
53#endif
int Int_t
Definition: RtypesCore.h:45
unsigned long ULong_t
Definition: RtypesCore.h:55
const char Option_t
Definition: RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition: Rtypes.h:329
TODBCRow(const TODBCRow &)=delete
char ** fBuffer
Definition: TODBCRow.h:33
void Close(Option_t *opt="") final
Close row.
Definition: TODBCRow.cxx:52
const char * GetField(Int_t field) final
Get specified field from row (0 <= field < GetFieldCount()).
Definition: TODBCRow.cxx:124
ULong_t GetFieldLength(Int_t field) final
Get length in bytes of specified field.
Definition: TODBCRow.cxx:114
Int_t fFieldCount
Definition: TODBCRow.h:32
TODBCRow & operator=(const TODBCRow &)=delete
SQLHSTMT fHstmt
Definition: TODBCRow.h:31
ULong_t * fLengths
Definition: TODBCRow.h:34
virtual ~TODBCRow()
Destroy row object.
Definition: TODBCRow.cxx:44
void CopyFieldValue(Int_t field)
Extracts field value from statement.
Definition: TODBCRow.cxx:73