#include <sqldb.h>
Inheritance diagram for Dv::Sql::Command_:
Protected Member Functions | |
unsigned int | nrows () |
Return number of rows in the query result. | |
void | nrows (unsigned int n) |
Set number of rows in the query result. | |
void | ncols (unsigned int n) |
Set number of columns in the query result. | |
void | run () |
Mark the command (and associated Dv::Sql::Command) as having been executed. | |
std::string | err () |
Return status string of this command. | |
void | err (const char *s) |
Set status string of this command. | |
void | ok (bool b) |
Set status of this command. | |
std::ostringstream & | textstream () |
Retrieve text of the command as a string stream. | |
Command_ (Command &cmd) | |
Constructor: the associated Dv::Sql::Command object must already exist. | |
virtual | ~Command_ () |
Destructor, virtual because it will be subclassed. | |
virtual bool | exec ()=0 |
Actually execute the command, DBMS-dependent. | |
virtual Db & | db ()=0 |
Return database connection associated with this command. | |
virtual void | escape (const std::string &s) |
Write s in properly quoted and escaped form to this->textstream(). | |
virtual void | fetch (std::vector< std::string > &, unsigned int r)=0 throw (Exception) |
Low level retrieval: put row # r from query result into the parameter. | |
virtual void | fetch (std::string &, unsigned int r, unsigned int c) throw (Exception) |
Low level retrieval: get column c from row # r from query result. | |
virtual const std::vector< Field > & | fields ()=0 |
Return field information for the query result. | |
virtual unsigned int | insertid () const |
Return id of auto_increment field of last insertion. | |
Protected Attributes | |
Command & | cmd_ |
Associated DBMS-independent Dv::Sql::Command object. | |
Private Member Functions | |
Command_ (const Command_ &) | |
Command_ & | operator= (const Command_ &) |
Friends | |
class | Command |
Friend. |
This class needs to be subclassed for a particular DBMS. A Dv::Sql::Command_ object forms a pair with a Dv::Sql::Command object: each contains a reference (or pointer) to the other. The Dv::Sql::Command_ object associated with a Dv::Sql::Command object cmd is created using the Dv::Sql::Db virtual member function Sql::Db::command_(cmd).
There is delegation in both ways: Dv::Sql::Command_ uses Dv::Sql::Command to perform some DBMS-independent operations and Dv::Sql::Command delegates all DBMS-dependent operations to Dv::Sql::Command_.
Definition at line 470 of file sqldb.h.
|
Constructor: the associated Dv::Sql::Command object must already exist.
|
|
Destructor, virtual because it will be subclassed.
Reimplemented in Dv::MySql::Command_. |
|
|
|
Return number of rows in the query result.
|
|
Set number of rows in the query result.
|
|
Set number of columns in the query result.
|
|
Mark the command (and associated Dv::Sql::Command) as having been executed.
|
|
Return status string of this command.
|
|
Set status string of this command.
|
|
Set status of this command.
|
|
Retrieve text of the command as a string stream.
|
|
Actually execute the command, DBMS-dependent.
Implemented in Dv::MySql::Command_. Referenced by Dv::Sql::Command::exec(). |
|
Return database connection associated with this command.
Implemented in Dv::MySql::Command_. Referenced by Dv::Sql::Command::db(). |
|
Write s in properly quoted and escaped form to this->textstream().
Reimplemented in Dv::MySql::Command_. |
|
Low level retrieval: put row # r from query result into the parameter.
Implemented in Dv::MySql::Command_. Referenced by Dv::Sql::Command::fetch(). |
|
Low level retrieval: get column c from row # r from query result. An exception is thrown if any of r or c is out of range. Reimplemented in Dv::MySql::Command_. |
|
Return field information for the query result.
Implemented in Dv::MySql::Command_. Referenced by Dv::Sql::Command::fields(). |
|
Return id of auto_increment field of last insertion.
Reimplemented in Dv::MySql::Command_. Referenced by Dv::Sql::Command::insertid(). |
|
|
|
Friend.
|
|
Associated DBMS-independent Dv::Sql::Command object.
|