ARC SDK
Public Member Functions
Arc::MySQLQuery Class Reference

Implements a MySQL version of the Query database query class. More...

#include <arc/MysqlWrapper.h>

Inheritance diagram for Arc::MySQLQuery:
Arc::Query

Public Member Functions

 MySQLQuery (Database *db)
 
virtual int get_num_colums ()
 Get the column number in the query result. More...
 
virtual int get_num_rows ()
 Get the row number in the query result. More...
 
virtual bool execute (const std::string &sqlstr)
 Execute the query. More...
 
virtual QueryRowResult get_row (int row_number) const
 Get the value of one row in the query result. More...
 
virtual QueryRowResult get_row () const
 Get the value of one row in the query result. More...
 
virtual std::string get_row_field (int row_number, std::string &field_name)
 Get the value of one specific field in one specific row. More...
 
virtual bool get_array (std::string &sqlstr, QueryArrayResult &result, std::vector< std::string > &arguments)
 Query the database by using some parameters into sql sentence. More...
 
- Public Member Functions inherited from Arc::Query
 Query ()
 Default constructor. More...
 
 Query (Database *db)
 Constructor. More...
 
virtual ~Query ()
 Deconstructor. More...
 

Detailed Description

Implements a MySQL version of the Query database query class.

Member Function Documentation

virtual bool Arc::MySQLQuery::execute ( const std::string &  sqlstr)
virtual

Execute the query.

Parameters
sqlstrThe sql sentence used to query

Implements Arc::Query.

virtual bool Arc::MySQLQuery::get_array ( std::string &  sqlstr,
QueryArrayResult &  result,
std::vector< std::string > &  arguments 
)
virtual

Query the database by using some parameters into sql sentence.

An example sentence: "select table.value from table where table.name = ?"

Parameters
sqlstrThe sql sentence with some parameters marked with "?".
resultThe result in an array which includes all of the value in query result.
argumentsThe argument list which should exactly correspond with the parameters in the sql sentence.

Implements Arc::Query.

virtual int Arc::MySQLQuery::get_num_colums ( )
virtual

Get the column number in the query result.

Implements Arc::Query.

virtual int Arc::MySQLQuery::get_num_rows ( )
virtual

Get the row number in the query result.

Implements Arc::Query.

virtual QueryRowResult Arc::MySQLQuery::get_row ( int  row_number) const
virtual

Get the value of one row in the query result.

Parameters
row_numberThe number of the row
Returns
A vector includes all the values in the row

Implements Arc::Query.

virtual QueryRowResult Arc::MySQLQuery::get_row ( ) const
virtual

Get the value of one row in the query result.

The row number will be automatically increased each time the method is called.

Implements Arc::Query.

virtual std::string Arc::MySQLQuery::get_row_field ( int  row_number,
std::string &  field_name 
)
virtual

Get the value of one specific field in one specific row.

Parameters
row_numberThe row number inside the query result
field_nameThe field name for the value which will be return
Returns
The value of the specified filed in the specified row

Implements Arc::Query.


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