Public Member Functions | |
| Query () | |
| Query (Database *db) | |
| virtual | ~Query () |
| virtual int | get_num_colums ()=0 |
| virtual int | get_num_rows ()=0 |
| virtual bool | execute (const std::string &sqlstr)=0 |
| virtual QueryRowResult | get_row (int row_number) const =0 |
| virtual QueryRowResult | get_row () const =0 |
| virtual std::string | get_row_field (int row_number, std::string &field_name)=0 |
| virtual bool | get_array (std::string &sqlstr, QueryArrayResult &result, std::vector< std::string > &arguments)=0 |
| Arc::Query::Query | ( | ) | [inline] |
Default constructor
| Arc::Query::Query | ( | Database * | db | ) | [inline] |
Constructor
| db | The database object which will be used by Query class to get the database connection |
| virtual Arc::Query::~Query | ( | ) | [inline, virtual] |
Deconstructor
| virtual bool Arc::Query::execute | ( | const std::string & | sqlstr | ) | [pure virtual] |
| virtual bool Arc::Query::get_array | ( | std::string & | sqlstr, | |
| QueryArrayResult & | result, | |||
| std::vector< std::string > & | arguments | |||
| ) | [pure virtual] |
Query the database by using some parameters into sql sentence e.g. "select table.value from table where table.name = ?"
| sqlstr | The sql sentence with some parameters marked with "?". | |
| result | The result in an array which includes all of the value in query result. | |
| arguments | The argument list which should exactely correspond with the parametes in sql sentence. |
Implemented in Arc::MySQLQuery.
| virtual int Arc::Query::get_num_colums | ( | ) | [pure virtual] |
Get the colum number in the query result
Implemented in Arc::MySQLQuery.
| virtual int Arc::Query::get_num_rows | ( | ) | [pure virtual] |
Get the row number in the query result
Implemented in Arc::MySQLQuery.
| virtual QueryRowResult Arc::Query::get_row | ( | ) | const [pure virtual] |
Get the value of one row in the query result, the row number will be automatically increased each time the method is called
Implemented in Arc::MySQLQuery.
| virtual QueryRowResult Arc::Query::get_row | ( | int | row_number | ) | const [pure virtual] |
Get the value of one row in the query result
| row_number | The number of the row |
Implemented in Arc::MySQLQuery.
| virtual std::string Arc::Query::get_row_field | ( | int | row_number, | |
| std::string & | field_name | |||
| ) | [pure virtual] |
Get the value of one specific field in one specific row
| row_number | The row number inside the query result | |
| field_name | The field name for the value which will be return |
Implemented in Arc::MySQLQuery.
1.6.3