Classes | Public Member Functions | Friends

SimpleDB::Query Class Reference

Class to represent a database query. More...

#include <Query.h>

List of all members.

Classes

class  Exception
 Query exception class. More...

Public Member Functions

 Query (Database &database)
 Constructor called by the Database object.
 DEPRECATED (Query(const Query &that))
 The overloaded copy constructor that creates a fresh query object It provides backwards compatability with some old code but should not be used in future.
 ~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.

Friends

class Database

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, and simple.cpp.


Constructor & Destructor Documentation

SimpleDB::Query::Query ( Database database  ) 

Constructor called by the Database object.

Parameters:
database Create a new query on the given database.

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, and simple.cpp.
SimpleDB::Query::DEPRECATED ( Query(const Query &that)   ) 

The overloaded copy constructor that creates a fresh query object It provides backwards compatability with some old code but should not be used in future.

Deprecated:
avoid copying query objects
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, 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, and simple.cpp.

The documentation for this class was generated from the following file:

Documentation pages generated by doxygen.
SourceForge.net Logo