library: libMySQL
#include "TMySQLStatement.h"

TMySQLStatement


class description - header file - source file - inheritance tree (.pdf)

class TMySQLStatement : public TSQLStatement

Inheritance Chart:
TObject
<-
TSQLStatement
<-
TMySQLStatement
    private:
void* BeforeSet(Int_t npar, Int_t sqltype, Bool_t sig = kTRUE, Int_t size = 0) long double ConvertToNumeric(Int_t npar) const char* ConvertToString(Int_t npar) void FreeBuffers() Bool_t IsResultSetMode() const Bool_t IsSetParsMode() const void SetBuffersNumber(Int_t n) Bool_t SetSQLParamType(Int_t npar, int sqltype, bool sig, int sqlsize = 0) public:
TMySQLStatement(MYSQL_STMT* stmt, Bool_t errout = kTRUE) TMySQLStatement(const TMySQLStatement&) virtual ~TMySQLStatement() static TClass* Class() virtual void Close(Option_t* = "") virtual Int_t GetBufferLength() const virtual Double_t GetDouble(Int_t npar) virtual const char* GetFieldName(Int_t nfield) virtual Int_t GetInt(Int_t npar) virtual Long_t GetLong(Int_t npar) virtual Long64_t GetLong64(Int_t npar) virtual Int_t GetNumAffectedRows() virtual Int_t GetNumFields() virtual Int_t GetNumParameters() virtual const char* GetString(Int_t npar) virtual UInt_t GetUInt(Int_t npar) virtual ULong64_t GetULong64(Int_t npar) virtual TClass* IsA() const virtual Bool_t IsNull(Int_t npar) virtual Bool_t NextIteration() virtual Bool_t NextResultRow() TMySQLStatement& operator=(const TMySQLStatement&) virtual Bool_t Process() virtual Bool_t SetDouble(Int_t npar, Double_t value) virtual Bool_t SetInt(Int_t npar, Int_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 SetNull(Int_t npar) virtual Bool_t SetString(Int_t npar, const char* value, Int_t maxsize = 256) virtual Bool_t SetUInt(Int_t npar, UInt_t value) virtual Bool_t SetULong64(Int_t npar, ULong64_t value) virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual Bool_t StoreResult() virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b)

Data Members

    private:
MYSQL_STMT* fStmt ! executed statement Int_t fNumBuffers ! number of statement parameters MYSQL_BIND* fBind ! array of bind data TMySQLStatement::TParamData* fBuffer ! parameter definition structures Int_t fWorkingMode ! 1 - setting parameters, 2 - retrieving results Int_t fIterationCount ! number of iteration Bool_t fNeedParBind ! indicates when parameters bind should be called

Class Description

                                                                      
  SQL statement class for MySQL                                       
                                                                      
  See TSQLStatement class documentation for more details.             
                                                                      

TMySQLStatement(MYSQL_STMT* stmt, Bool_t errout)
 Normal constructor
 Checks if statement contains parameters tags
~TMySQLStatement()
 destructor
void Close(Option_t *)
 Close statement
Bool_t Process()
 Process statement
Int_t GetNumAffectedRows()
 Return number of affected rows after statement is processed
Int_t GetNumParameters()
 Return number of statement parameters
Bool_t StoreResult()
 Store result of statement processing to access them
 via GetInt(), GetDouble() and so on methods.
Int_t GetNumFields()
 Return number of fields in result set
const char* GetFieldName(Int_t nfield)
 Returns field name in result set
Bool_t NextResultRow()
 Shift cursor to nect row in result set
Bool_t NextIteration()
 Increment iteration counter for statement, where parameter can be set.
 Statement with parameters of previous iteration
 automatically will be applied to database
void FreeBuffers()
 Release all buffers, used by statement
void SetBuffersNumber(Int_t numpars)
 Allocate buffers for statement parameters/ result fields
const char* ConvertToString(Int_t npar)
 Convert field value to string
long double ConvertToNumeric(Int_t npar)
 Convert field to numeric value
Bool_t IsNull(Int_t npar)
 Checks if field value is null
Int_t GetInt(Int_t npar)
 Return field value as integer
UInt_t GetUInt(Int_t npar)
 Return field value as unsigned integer
Long_t GetLong(Int_t npar)
 Return field value as long integer
Long64_t GetLong64(Int_t npar)
 Return field value as 64-bit integer
ULong64_t GetULong64(Int_t npar)
 Return field value as unsigned 64-bit integer
Double_t GetDouble(Int_t npar)
 Return field value as double
const char * GetString(Int_t npar)
 Return field value as string
Bool_t SetSQLParamType(Int_t npar, int sqltype, bool sig, int sqlsize)
 Set parameter type to be used as buffer
 Used in both setting data to database and retriving data from data base
 Initialize proper MYSQL_BIND structure and allocate required buffers
void * BeforeSet(Int_t npar, Int_t sqltype, Bool_t sig, Int_t size)
 Check boundary condition before setting value of parameter
 Return address of parameter buffer
Bool_t SetNull(Int_t npar)
 Set NULL as parameter value
 If NULL should be set for statement parameter during first iteration,
 one should call before proper Set... method to identify type of argument for
 the future. For instance, if one suppose to have double as type of parameter,
 code should look like:
    stmt->SetDouble(2, 0.);
    stmt->SetNull(2);
Bool_t SetInt(Int_t npar, Int_t value)
 Set parameter value as integer
Bool_t SetUInt(Int_t npar, UInt_t value)
 Set parameter value as unsigned integer
Bool_t SetLong(Int_t npar, Long_t value)
 Set parameter value as long integer
Bool_t SetLong64(Int_t npar, Long64_t value)
 Set parameter value as 64-bit integer
Bool_t SetULong64(Int_t npar, ULong64_t value)
 Set parameter value as unsigned 64-bit integer
Bool_t SetDouble(Int_t npar, Double_t value)
 Set parameter value as double
Bool_t SetString(Int_t npar, const char* value, Int_t maxsize)
 Set parameter value as string
TMySQLStatement(MYSQL_STMT*, Bool_t)
 Normal constructor
 For MySQL version < 4.1 no statement is supported
Bool_t IsSetParsMode()
Bool_t IsResultSetMode()
Int_t GetBufferLength()

Author: Sergey Linev 6/02/2006
Last update: root/mysql:$Name: $:$Id: TMySQLStatement.cxx,v 1.6 2006/06/30 06:36:35 brun Exp $
Copyright (C) 1995-2006, Rene Brun and Fons Rademakers. *


ROOT page - Class index - Class Hierarchy - Top of the page

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.