#include <basicDatabase.h>
Public Member Functions | |
virtual void | commit () |
Commits transactions on all connections. | |
virtual void | rollback () |
Rolls back transactions on all connections. | |
virtual Connection * | getConnection (const std::string &connStr) |
Creates a new connection to this database. | |
virtual void | returnConnection (Connection *connection) |
Releases the connection created with Database::getConnection(). | |
virtual void | disconnect () |
Commits all connections on the database, then disconnects them from database. | |
DatabaseImpl * | getImplementation () |
Returns the driver-side part of the Database implemenation. | |
Driver & | getDriver () |
Returns a reference to a Driver associated with this database. | |
virtual Database * | getBasicDatabase () |
Returns the driver-independent part of the Database implementation. |
virtual Connection* iopc::BasicDatabase::getConnection | ( | const std::string & | connStr | ) | [virtual] |
Creates a new connection to this database.
Connection must be opened by calling Connection::open() before executing any SQL commands.
connStr | A connection string. Its format is defined by the database driver. Usually it identifies the database user/schema. |
Implements iopc::Database.
void iopc::BasicDatabase::returnConnection | ( | Connection * | connection | ) | [virtual] |
Releases the connection created with Database::getConnection().
Any connection that was created using Database::getConnection() must be passed to this method when no longer needed.
connection | The connection to be released |
Implements iopc::Database.
void iopc::BasicDatabase::disconnect | ( | ) | [virtual] |
Commits all connections on the database, then disconnects them from database.
The connections are removed from the connection set. (No returnConnection() is needed)
Implements iopc::Database.