Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | Related Pages | Examples

SimpleDB::Query Class Reference

Class to represent a database query. More...

#include <Query.h>

List of all members.

Public Member Functions

 Query (SQLHDBC connectionHandle)
 Constructor called by the Database object.
 ~Query ()
 Destructor deallocates any memory or resources.
void bind (Column *columns[], int numberColumns)
 Bind the given columns to this query context.
void execute (const std::string &sqlQuery)
 Execute the given query.
bool fetchRow ()
 Fetches a row of data returned by the SQL query.

Protected Attributes

SQLHSTMT statementHandle
 ODBC statement handle.
SQLHDBC connectionHandle
 ODBC connection handle.

Classes

class  Exception
 Query exception class. More...


Detailed Description

Class to represent a database query.

This class is created by the Database object. It encapsulates details pertaining to a database query.

Examples:

complete.cpp, factory.cpp, and simple.cpp.


Constructor & Destructor Documentation

SimpleDB::Query::Query SQLHDBC  connectionHandle  ) 
 

Constructor called by the Database object.

Parameters:
connectionHandle The connection handle from a database object.


Member Function Documentation

void SimpleDB::Query::bind Column columns[],
int  numberColumns
 

Bind the given columns to this query context.

Parameters:
columns An array of columns to bind to this query.
numberColumns The number of columns in the array.
Examples:
complete.cpp, factory.cpp, and simple.cpp.

void SimpleDB::Query::execute const std::string &  sqlQuery  ) 
 

Execute the given query.

Parameters:
sqlQuery The SQL query.
Exceptions:
Database::NoDataException if the return from the SQL query is SQL_NO_DATA
Exception When there is a problem with the database or with the query itself.
Examples:
complete.cpp, factory.cpp, and simple.cpp.

bool SimpleDB::Query::fetchRow  ) 
 

Fetches a row of data returned by the SQL query.

Returns:
Returns false if there is no data to be returned.
Examples:
complete.cpp, factory.cpp, and simple.cpp.


The documentation for this class was generated from the following file:
Copyright (C) 2005 Eminence Technology Pty Ltd.
Documentation pages generated by doxygen.

SourceForge.net Logo