Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

DOQuery Class Reference

Holds the result of a query. More...

#include <Query.h>

Inheritance diagram for DOQuery:

DOSnapshot List of all members.

Public Methods

void DeleteAllQueryField ()
DOQueryFieldGetFirstQueryField () const
DOQueryFieldGetLastQueryField () const
DOQueryFieldGetNextQueryField (DOQueryField *pos) const
DOQueryFieldGetPrevQueryField (DOQueryField *pos) const
int GetQueryFieldCount () const
void MoveQueryFieldFirst (DOQueryField *item)
void MoveQueryFieldLast (DOQueryField *item)
void MoveQueryFieldAfter (DOQueryField *item, DOQueryField *pos)
void MoveQueryFieldBefore (DOQueryField *item, DOQueryField *pos)
void SortQueryField (int(*comp)(DOQueryField *, DOQueryField *))
DOConnectionGetConnection () const
 DOQuery (DOConnection *pConnection)
 Constructor method. More...

virtual ~DOQuery ()
 Destructor method. More...

bool Fetch ()
 Fetch the next row from the query result, if any. More...

DOQueryFieldFindQueryField (unsigned int number)
DOQueryFieldFindQueryField (const char *fldName)
 Find a field by the field name. More...

unsigned int GetNumFields ()
 Return the number of fields in the query result. More...

unsigned int GetNumRows ()
 return the number of rows in the query result. More...

bool Query (const char *pszSQL)
 initiate a (new) query to the database server. More...

void Seek (unsigned int rownum)
 select a row by number. More...

MYSQL_ROW GetRow ()
 Returns the value of member 'm_row'. More...


Public Attributes

DOQueryField_firstQueryField
DOQueryField_lastQueryField
int _countQueryField
DOConnection_refConnection
DOQuery* _prevConnection
DOQuery* _nextConnection

Protected Methods

void AddQueryFieldFirst (DOQueryField *item)
void AddQueryFieldLast (DOQueryField *item)
void AddQueryFieldAfter (DOQueryField *item, DOQueryField *pos)
void AddQueryFieldBefore (DOQueryField *item, DOQueryField *pos)
void RemoveQueryField (DOQueryField *item)
void ReplaceQueryField (DOQueryField *item, DOQueryField *newItem)

Protected Attributes

CString m_query

Private Methods

void ConstructorInclude (DOConnection *pConnection)
 Method which must be called first in a constructor. More...

void DestructorInclude ()
 Method which must be called first in a destructor. More...


Private Attributes

MYSQL_RES* m_pRes
MYSQL_ROW m_row

Detailed Description

Holds the result of a query.

Definition at line 81 of file Query.h.


Constructor & Destructor Documentation

DOQuery::DOQuery ( DOConnection * pConnection )
 

Constructor method.

Definition at line 84 of file Query.cpp.

DOQuery::~DOQuery ( ) [virtual]
 

Destructor method.

Definition at line 98 of file Query.cpp.


Member Function Documentation

void DOQuery::AddQueryFieldAfter ( DOQueryField * item,
DOQueryField * pos ) [protected]
 

Definition at line 305 of file Query.cpp.

Referenced by MoveQueryFieldAfter().

void DOQuery::AddQueryFieldBefore ( DOQueryField * item,
DOQueryField * pos ) [protected]
 

Definition at line 329 of file Query.cpp.

Referenced by MoveQueryFieldBefore().

void DOQuery::AddQueryFieldFirst ( DOQueryField * item ) [protected]
 

Definition at line 261 of file Query.cpp.

Referenced by MoveQueryFieldFirst().

void DOQuery::AddQueryFieldLast ( DOQueryField * item ) [protected]
 

Definition at line 283 of file Query.cpp.

Referenced by MoveQueryFieldLast().

void DOQuery::ConstructorInclude ( DOConnection * pConnection ) [private]
 

Method which must be called first in a constructor.

Definition at line 195 of file Query.cpp.

void DOQuery::DeleteAllQueryField ( )
 

Definition at line 380 of file Query.cpp.

Referenced by Query().

void DOQuery::DestructorInclude ( ) [private]
 

Method which must be called first in a destructor.

Reimplemented in DOSnapshot.

Definition at line 228 of file Query.cpp.

Referenced by ~DOQuery().

bool DOQuery::Fetch ( )
 

Fetch the next row from the query result, if any.

Definition at line 111 of file Query.cpp.

Referenced by Query(), and Seek().

DOQueryField * DOQuery::FindQueryField ( const char * fldName )
 

Find a field by the field name.

Definition at line 138 of file Query.cpp.

DOQueryField * DOQuery::FindQueryField ( unsigned int number )
 

Definition at line 120 of file Query.cpp.

Referenced by IRPlus::InsertIRFieldRecord(), DOSnapshot::Let(), IRPlus::newMeth(), and IRPlus::newParam().

DOConnection * DOQuery::GetConnection ( ) const [inline]
 

Definition at line 187 of file Query.h.

Referenced by DOSnapshot::CommitAdd(), DOSnapshot::CommitEdit(), and Query().

DOQueryField * DOQuery::GetFirstQueryField ( ) const
 

Definition at line 421 of file Query.cpp.

Referenced by DeleteAllQueryField(), DestructorInclude(), and DOQuery::QueryFieldIterator::IsFirst().

DOQueryField * DOQuery::GetLastQueryField ( ) const
 

Definition at line 428 of file Query.cpp.

Referenced by DOQuery::QueryFieldIterator::IsLast().

DOQueryField * DOQuery::GetNextQueryField ( DOQueryField * pos ) const
 

Definition at line 435 of file Query.cpp.

Referenced by DOQuery::QueryFieldIterator::Check(), and DOQuery::QueryFieldIterator::operator++().

unsigned int DOQuery::GetNumFields ( ) [inline]
 

Return the number of fields in the query result.

Definition at line 232 of file Query.h.

Referenced by DOSnapshot::AddNew(), DOSnapshot::Edit(), DOSnapshot::Let(), Query(), and DOSnapshot::~DOSnapshot().

unsigned int DOQuery::GetNumRows ( ) [inline]
 

return the number of rows in the query result.

Definition at line 246 of file Query.h.

Referenced by DOSnapshot::CommitEdit(), IRPlus::InsertIRFieldRecord(), IRPlus::newMeth(), and IRPlus::newParam().

DOQueryField * DOQuery::GetPrevQueryField ( DOQueryField * pos ) const
 

Definition at line 449 of file Query.cpp.

Referenced by DOQuery::QueryFieldIterator::Check(), and DOQuery::QueryFieldIterator::operator--().

int DOQuery::GetQueryFieldCount ( ) const
 

Definition at line 463 of file Query.cpp.

MYSQL_ROW DOQuery::GetRow ( ) [inline]
 

Returns the value of member 'm_row'.

Definition at line 273 of file Query.h.

Referenced by DOQueryField::GetValue(), and DOQueryField::isNull().

void DOQuery::MoveQueryFieldAfter ( DOQueryField * item,
DOQueryField * pos )
 

Definition at line 488 of file Query.cpp.

void DOQuery::MoveQueryFieldBefore ( DOQueryField * item,
DOQueryField * pos )
 

Definition at line 497 of file Query.cpp.

void DOQuery::MoveQueryFieldFirst ( DOQueryField * item )
 

Definition at line 470 of file Query.cpp.

void DOQuery::MoveQueryFieldLast ( DOQueryField * item )
 

Definition at line 479 of file Query.cpp.

bool DOQuery::Query ( const char * pszSQL )
 

initiate a (new) query to the database server.

Performs the query and retrieves the result, if any. Note that some queries do not return a result (e.g. insert, update). If there is a result the first row is fetched as well.

Definition at line 161 of file Query.cpp.

Referenced by DOSnapshot::CommitAdd(), DOSnapshot::CommitEdit(), IRPlus::InsertIRFieldRecord(), IRPlus::createTables(), IRPlus::newMeth(), and IRPlus::newParam().

void DOQuery::RemoveQueryField ( DOQueryField * item ) [protected]
 

Definition at line 353 of file Query.cpp.

Referenced by MoveQueryFieldAfter(), MoveQueryFieldBefore(), MoveQueryFieldFirst(), and MoveQueryFieldLast().

void DOQuery::ReplaceQueryField ( DOQueryField * item,
DOQueryField * newItem ) [protected]
 

Definition at line 389 of file Query.cpp.

void DOQuery::Seek ( unsigned int rownum ) [inline]
 

select a row by number.

Definition at line 260 of file Query.h.

void DOQuery::SortQueryField ( int(* comp)(DOQueryField *, DOQueryField *) )
 

Definition at line 506 of file Query.cpp.


Member Data Documentation

int DOQuery::_countQueryField
 

Definition at line 87 of file Query.h.

DOQueryField * DOQuery::_firstQueryField
 

Definition at line 85 of file Query.h.

DOQueryField * DOQuery::_lastQueryField
 

Definition at line 86 of file Query.h.

DOQuery * DOQuery::_nextConnection
 

Definition at line 184 of file Query.h.

DOQuery * DOQuery::_prevConnection
 

Definition at line 183 of file Query.h.

DOConnection * DOQuery::_refConnection
 

Definition at line 182 of file Query.h.

MYSQL_RES * DOQuery::m_pRes [private]
 

Definition at line 194 of file Query.h.

CString DOQuery::m_query [protected]
 

Definition at line 198 of file Query.h.

MYSQL_ROW DOQuery::m_row [private]
 

Definition at line 195 of file Query.h.


The documentation for this class was generated from the following files:
This documentation is part of the "SOAP to CORBA bridge" project
Copyright © 2000 by Lifeline Networks bv.
All rights are reserved.