SqlQuery Class Reference

Class to send queries and retrieve results to and from a database. More...

#include <sqlquery.hpp>

List of all members.

Public Member Functions

 SqlQuery (const SqlDatabase &db)
 Constructor.
SqlResult operator() (const string &sql)
 Send a query.
SqlResult operator() (ostringstream &sql)
 Send a query.


Detailed Description

Class to send queries and retrieve results to and from a database.

 SqlDatabase *db = new Sqlite3Context( "test.db" );        // open connection
 SqlQuery query( *db );
 query( "INSERT INTO my_table VALUES( 1, 2, 'three' );" ); // used as a function
 delete db;                                                // closed and cleaned up

Definition at line 48 of file sqlquery.hpp.


Constructor & Destructor Documentation

SqlQuery::SqlQuery ( const SqlDatabase db  ) 

Constructor.

Create a new object used for querying databases.

Parameters:
db A reference to an open database connection.

Definition at line 31 of file sqlquery.cpp.


Member Function Documentation

SqlResult SqlQuery::operator() ( const string &  sql  ) 

Send a query.

Send a string containing one or more SQL statements to the database connection you specified in the constructor.

Parameters:
sql The statement(s) you want to send.
Returns:
An SqlResult object containing the result set from the query.

SqlResult SqlQuery::operator() ( ostringstream &  sql  ) 

Send a query.


The documentation for this class was generated from the following files:
Generated on Sat Aug 18 16:21:45 2007 for SqlWrapperXX by  doxygen 1.5.0