Class to represent a database query. More...
#include <Query.h>
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 |
Class to represent a database query.
This class is created by the Database object. It encapsulates details pertaining to a database query.
complete.cpp, and simple.cpp.
| SimpleDB::Query::Query | ( | Database & | database | ) |
Constructor called by the Database object.
| database | Create a new query on the given database. |
| void SimpleDB::Query::bind | ( | Column * | columns[], | |
| int | numberColumns | |||
| ) |
Bind the given columns to this query context.
| columns | An array of columns to bind to this query. | |
| numberColumns | The number of columns in the array. |
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.
| void SimpleDB::Query::execute | ( | const std::string & | sqlQuery | ) |
Execute the given query.
| sqlQuery | The SQL query. |
| 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. |
| bool SimpleDB::Query::fetchRow | ( | ) |
Fetches a row of data returned by the SQL query.