Logo ROOT  
Reference Guide
TMySQLRow.h
Go to the documentation of this file.
1// @(#)root/mysql:$Id$
2// Author: Fons Rademakers 15/02/2000
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, 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_TMySQLRow
13#define ROOT_TMySQLRow
14
15#include "TSQLRow.h"
16
17#include <mysql.h>
18
19class TMySQLRow : public TSQLRow {
20
21private:
22 MYSQL_RES *fResult{nullptr}; // current result set
23 MYSQL_ROW fFields; // current row
24 ULong_t *fFieldLength{nullptr}; // length of each field in the row
25
26 Bool_t IsValid(Int_t field);
27
28public:
29 TMySQLRow(void *result, ULong_t rowHandle);
30 ~TMySQLRow();
31
32 void Close(Option_t *opt="") final;
33 ULong_t GetFieldLength(Int_t field) final;
34 const char *GetField(Int_t field) final;
35
36 ClassDefOverride(TMySQLRow,0) // One row of MySQL query result
37};
38
39#endif
40
int Int_t
Definition: RtypesCore.h:43
unsigned long ULong_t
Definition: RtypesCore.h:53
bool Bool_t
Definition: RtypesCore.h:61
const char Option_t
Definition: RtypesCore.h:64
#define ClassDefOverride(name, id)
Definition: Rtypes.h:326
MYSQL_RES * fResult
Definition: TMySQLRow.h:22
Bool_t IsValid(Int_t field)
Check if row is open and field index within range.
Definition: TMySQLRow.cxx:52
ULong_t GetFieldLength(Int_t field) final
Get length in bytes of specified field.
Definition: TMySQLRow.cxx:68
void Close(Option_t *opt="") final
Close row.
Definition: TMySQLRow.cxx:39
const char * GetField(Int_t field) final
Get specified field from row (0 <= field < GetFieldCount()).
Definition: TMySQLRow.cxx:87
~TMySQLRow()
Destroy row object.
Definition: TMySQLRow.cxx:30
MYSQL_ROW fFields
Definition: TMySQLRow.h:23
TMySQLRow(void *result, ULong_t rowHandle)
Single row of query result.
Definition: TMySQLRow.cxx:20
ULong_t * fFieldLength
Definition: TMySQLRow.h:24