iopc::Database Class Reference
[iopcdb]

Represents a database instance. More...

#include <database.h>

Inheritance diagram for iopc::Database:

Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual DrivergetDriver ()=0
 Returns a reference to a Driver associated with this database.
virtual ~Database ()
virtual void commit ()=0
 Commits transactions on all connections.
virtual void rollback ()=0
 Rolls back transactions on all connections.
virtual ConnectiongetConnection (const std::string &connStr)=0
 Creates a new connection to this database.
virtual void returnConnection (Connection *connection)=0
 Releases the connection created with Database::getConnection().
virtual void disconnect ()=0
 Commits all connections on the database, then disconnects them from database.
virtual DatabaseImplgetImplementation ()=0
 Returns the driver-side part of the Database implemenation.
virtual DatabasegetBasicDatabase ()=0
 Returns the driver-independent part of the Database implementation.


Detailed Description

Represents a database instance.

Methods of this class allow user to create and manipulate connections to this database.

Classes implementing this interface are thread safe and can be used by more threads concurrently.


Constructor & Destructor Documentation

virtual iopc::Database::~Database (  )  [inline, virtual]

Implementation should delete the inner instance


Member Function Documentation

virtual Connection* iopc::Database::getConnection ( const std::string &  connStr  )  [pure virtual]

Creates a new connection to this database.

Connection must be opened by calling Connection::open() before executing any SQL commands.

Parameters:
connStr A connection string. Its format is defined by the database driver. Usually it identifies the database user/schema.
Returns:
The Connection object representing the requested connection.
See also:
Connection

Implemented in iopc::BasicDatabase, and iopc::CachedDatabase.

virtual void iopc::Database::returnConnection ( Connection connection  )  [pure 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.

Parameters:
connection The connection to be released

Implemented in iopc::BasicDatabase, and iopc::CachedDatabase.

virtual void iopc::Database::disconnect (  )  [pure virtual]

Commits all connections on the database, then disconnects them from database.

The connections are removed from the connection set. (No returnConnection() is needed)

Implemented in iopc::BasicDatabase, and iopc::CachedDatabase.


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

Generated on Tue Apr 14 16:46:39 2009 for IOPC 2 by  doxygen 1.5.6