opendbx
1.4.6
|
Statement object. More...
Public Types | |
enum | Type |
Statement objects which can be created. More... | |
Public Member Functions | |
Result | execute () throw ( std::exception ) |
Executes a statement and returns a Result instance. More... | |
Stmt & | operator= (const Stmt &ref) throw () |
Assigns a statement instance to another one. More... | |
Stmt (const Stmt &ref) throw () | |
Copy constructor. More... | |
~Stmt () throw () | |
Destroys the statement instance if no other references exist. More... | |
Protected Member Functions | |
Stmt () throw () | |
Default constructor. More... | |
Stmt (Stmt_Iface *impl) throw ( std::exception ) | |
Creates a statement instance. More... | |
Statement object.
enum OpenDBX::Stmt::Type |
Statement objects which can be created.
Currently, only simple processing of statements is supported which means that the statement sent to the database server consists of the statement and the parameters in text form. Later on, also prepared statements will be available which separates parsing and execution with different parameters.
|
inlineprotected |
Default constructor.
The default constructor isn't part of the public interface as the object must not be created manually. Instead, the Conn::create() method is a factory for instances of the Stmt class.
|
protected |
Creates a statement instance.
The constructor isn't part of the public interface as the object must not be created manually. Instead, the Conn::create() method is a factory for instances of the Stmt class.
impl | Pointer to private implementation |
std::exception | If an error occures |
OpenDBX::Stmt::~Stmt | ( | ) | ||
throw | ( | |||
) |
Destroys the statement instance if no other references exist.
Each statement object uses a reference counter to remember if the internal variables are shared with other objects. If this isn't the case or if this object is the last one referencing the variables, the object is cleaned up and the allocated memory freed.
OpenDBX::Stmt::Stmt | ( | const Stmt & | ref | ) | |
throw | ( | ||||
) |
Copy constructor.
Enables the transfer of the internal state of an object ref of the same type to this object. Both objects share the same variables and the reference counter afterwards. The reference counter is incremented each time an object is copied and will be decremented if it is destroyed.
ref | Original statement object instance |
Result OpenDBX::Stmt::execute | ( | ) | ||
throw | ( | std::exception | ||
) |
Executes a statement and returns a Result instance.
Sends the necessary data to the database server which will execute the statement and return one or more result sets afterwards. The result sets can be fetched via the returned Result object.
OpenDBX::Exception | If the underlying database library returns an error |
Assigns a statement instance to another one.
Assigns the internal state of an object ref of the same type to this object. Both objects share the same variables and the reference counter afterwards. The reference counter is incremented each time an object is copied and will be decremented if it is destroyed.
ref | Stmt instance |