#ifndef ROOT_TMySQLStatement
#define ROOT_TMySQLStatement
#ifndef ROOT_TSQLStatement
#include "TSQLStatement.h"
#endif
#if !defined(__CINT__)
#ifdef R__WIN32
#include <winsock.h>
#else
#include <sys/time.h>
#endif
#include <mysql.h>
#if MYSQL_VERSION_ID < 40100
typedef struct { int dummy; } MYSQL_STMT;
typedef struct { int dummy; } MYSQL_BIND;
#endif
#else
struct MYSQL_STMT;
struct MYSQL_BIND;
typedef char my_bool;
#endif
class TMySQLStatement : public TSQLStatement {
protected:
struct TParamData {
void* fMem;
Int_t fSize;
Int_t fSqlType;
Bool_t fSign;
ULong_t fResLength;
my_bool fResNull;
char* fStrBuffer;
char* fFieldName;
};
MYSQL_STMT *fStmt;
Int_t fNumBuffers;
MYSQL_BIND *fBind;
TParamData *fBuffer;
Int_t fWorkingMode;
Int_t fIterationCount;
Bool_t fNeedParBind;
Bool_t IsSetParsMode() const { return fWorkingMode==1; }
Bool_t IsResultSetMode() const { return fWorkingMode==2; }
Bool_t SetSQLParamType(Int_t npar, int sqltype, bool sig, int sqlsize = 0);
long double ConvertToNumeric(Int_t npar);
const char *ConvertToString(Int_t npar);
void FreeBuffers();
void SetBuffersNumber(Int_t n);
void *BeforeSet(const char* method, Int_t npar, Int_t sqltype, Bool_t sig = kTRUE, Int_t size = 0);
public:
TMySQLStatement(MYSQL_STMT* stmt, Bool_t errout = kTRUE);
virtual ~TMySQLStatement();
virtual void Close(Option_t * = "");
virtual Int_t GetBufferLength() const { return 1; }
virtual Int_t GetNumParameters();
virtual Bool_t SetNull(Int_t npar);
virtual Bool_t SetInt(Int_t npar, Int_t value);
virtual Bool_t SetUInt(Int_t npar, UInt_t value);
virtual Bool_t SetLong(Int_t npar, Long_t value);
virtual Bool_t SetLong64(Int_t npar, Long64_t value);
virtual Bool_t SetULong64(Int_t npar, ULong64_t value);
virtual Bool_t SetDouble(Int_t npar, Double_t value);
virtual Bool_t SetString(Int_t npar, const char* value, Int_t maxsize = 256);
virtual Bool_t SetBinary(Int_t npar, void* mem, Long_t size, Long_t maxsize = 0x1000);
virtual Bool_t SetDate(Int_t npar, Int_t year, Int_t month, Int_t day);
virtual Bool_t SetTime(Int_t npar, Int_t hour, Int_t min, Int_t sec);
virtual Bool_t SetDatime(Int_t npar, Int_t year, Int_t month, Int_t day, Int_t hour, Int_t min, Int_t sec);
virtual Bool_t SetTimestamp(Int_t npar, Int_t year, Int_t month, Int_t day, Int_t hour, Int_t min, Int_t sec, Int_t frac = 0);
virtual Bool_t NextIteration();
virtual Bool_t Process();
virtual Int_t GetNumAffectedRows();
virtual Bool_t StoreResult();
virtual Int_t GetNumFields();
virtual const char *GetFieldName(Int_t nfield);
virtual Bool_t NextResultRow();
virtual Bool_t IsNull(Int_t npar);
virtual Int_t GetInt(Int_t npar);
virtual UInt_t GetUInt(Int_t npar);
virtual Long_t GetLong(Int_t npar);
virtual Long64_t GetLong64(Int_t npar);
virtual ULong64_t GetULong64(Int_t npar);
virtual Double_t GetDouble(Int_t npar);
virtual const char *GetString(Int_t npar);
virtual Bool_t GetBinary(Int_t npar, void* &mem, Long_t& size);
virtual Bool_t GetDate(Int_t npar, Int_t& year, Int_t& month, Int_t& day);
virtual Bool_t GetTime(Int_t npar, Int_t& hour, Int_t& min, Int_t& sec);
virtual Bool_t GetDatime(Int_t npar, Int_t& year, Int_t& month, Int_t& day, Int_t& hour, Int_t& min, Int_t& sec);
virtual Bool_t GetTimestamp(Int_t npar, Int_t& year, Int_t& month, Int_t& day, Int_t& hour, Int_t& min, Int_t& sec, Int_t&);
ClassDef(TMySQLStatement, 0);
};
#endif
Last update: Thu Jan 17 09:00:20 2008
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.