Back to index

nordugrid-arc-nox  1.1.0~rc6
Public Member Functions
Arc::Query Class Reference

#include <DBInterface.h>

Inheritance diagram for Arc::Query:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 Query ()
 Default constructor.
 Query (Database *db)
 Constructor.
virtual ~Query ()
 Deconstructor.
virtual int get_num_colums ()=0
 Get the colum number in the query result.
virtual int get_num_rows ()=0
 Get the row number in the query result.
virtual bool execute (const std::string &sqlstr)=0
 Execute the query.
virtual QueryRowResult get_row (int row_number) const =0
 Get the value of one row in the query result.
virtual QueryRowResult get_row () const =0
 Get the value of one row in the query result, the row number will be automatically increased each time the method is called.
virtual std::string get_row_field (int row_number, std::string &field_name)=0
 Get the value of one specific field in one specific row.
virtual bool get_array (std::string &sqlstr, QueryArrayResult &result, std::vector< std::string > &arguments)=0
 Query the database by using some parameters into sql sentence e.g.

Detailed Description

Definition at line 52 of file DBInterface.h.


Constructor & Destructor Documentation

Arc::Query::Query ( ) [inline]

Default constructor.

Definition at line 55 of file DBInterface.h.

{}
Arc::Query::Query ( Database db) [inline]

Constructor.

Parameters:
dbThe database object which will be used by Query class to get the database connection

Definition at line 58 of file DBInterface.h.

{}
virtual Arc::Query::~Query ( ) [inline, virtual]

Deconstructor.

Definition at line 61 of file DBInterface.h.

{}

Member Function Documentation

virtual bool Arc::Query::execute ( const std::string &  sqlstr) [pure virtual]

Execute the query.

Parameters:
sqlstrThe sql sentence used to query

Implemented in Arc::MySQLQuery.

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 = ?"

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 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 ( int  row_number) const [pure 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

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 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.

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

Implemented in Arc::MySQLQuery.


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