#include <connection.h>
Public Member Functions | |
virtual Cursor * | sql (const std::string &name)=0 |
Sends an SQL statement (a query) to an associated database. | |
virtual void | returnCursor (Cursor *cur)=0 |
Cursors that are no longer needed should be returned to the driver Connection object using this method. | |
virtual void | closeAllCursors ()=0 |
Closes and returns all cursors on this connection. | |
virtual void | sqlNonQuery (const std::string &name)=0 |
Executes an SQL statement that does not return any rows (DDL, DML). | |
virtual void | commit ()=0 |
Commits current transaction. Starts new one. | |
virtual void | rollback ()=0 |
Rolls back current transaction. | |
virtual void | savepoint (const std::string &name)=0 |
Creates a savepoint. | |
virtual void | rollbackToSavepoint (const std::string &name)=0 |
Rolls back to the specified savepoint. | |
virtual void | open ()=0 |
Opens the connection. | |
virtual void | close ()=0 |
Closes the connection. | |
virtual void | disconnect ()=0 |
Commits last transaction and closes the connection. | |
virtual void | abort ()=0 |
Rolls back current transaction and closes the connection. | |
virtual void | setAutoCommit (bool ac)=0 |
Turns autocommit on this connection on or off. | |
virtual bool | isOpened ()=0 |
Determines whether this connection is opened or not. | |
virtual Connection & | operator<< (const std::string &command)=0 |
Shortcut for sqlNonQuery. | |
virtual Database & | getDatabase ()=0 |
Returns the associated Database object. | |
virtual Driver & | getDriver ()=0 |
Returns the database driver used. | |
virtual ConnectionImpl * | getImplementation ()=0 |
Returns the driver-side part of the Connection implemenation. | |
virtual Connection * | getBasicConnection ()=0 |
Returns the driver-independent part of the Connection implementation. |
This class encapsulates a single connection to a database. Connection allows users to send SQL commands to its associated database and to control transaction processing. It manages the cursors that are created by executing SQL via sql(const std::string& name) or getCursor(const std::string& name) methods.
virtual Cursor* iopc::Connection::sql | ( | const std::string & | name | ) | [pure virtual] |
Sends an SQL statement (a query) to an associated database.
Implemented in iopc::BasicConnection, and iopc::CachedConnection.
virtual void iopc::Connection::returnCursor | ( | Cursor * | cur | ) | [pure virtual] |
Cursors that are no longer needed should be returned to the driver Connection object using this method.
All resources allocated by the Cursor are released.
Implemented in iopc::BasicConnection, and iopc::CachedConnection.
virtual void iopc::Connection::sqlNonQuery | ( | const std::string & | name | ) | [pure virtual] |
Executes an SQL statement that does not return any rows (DDL, DML).
No Cursor object is created
Implemented in iopc::BasicConnection, and iopc::CachedConnection.
virtual void iopc::Connection::savepoint | ( | const std::string & | name | ) | [pure virtual] |
Creates a savepoint.
name | Savepoint name |
Implemented in iopc::BasicConnection, and iopc::CachedConnection.
virtual void iopc::Connection::rollbackToSavepoint | ( | const std::string & | name | ) | [pure virtual] |
Rolls back to the specified savepoint.
name | Name of the savepoint to which to roll back to. |
Implemented in iopc::BasicConnection, and iopc::CachedConnection.
virtual void iopc::Connection::open | ( | ) | [pure virtual] |
Opens the connection.
This call opens a physical link to the DBMS
Implemented in iopc::BasicConnection, and iopc::CachedConnection.
virtual void iopc::Connection::close | ( | ) | [pure virtual] |
Closes the connection.
This call should close the physical link to the DBMS
Implemented in iopc::BasicConnection, and iopc::CachedConnection.
virtual void iopc::Connection::disconnect | ( | ) | [pure virtual] |
Commits last transaction and closes the connection.
The connection still needs to be returned to associated Database object
Implemented in iopc::BasicConnection, and iopc::CachedConnection.
virtual void iopc::Connection::setAutoCommit | ( | bool | ac | ) | [pure virtual] |
Turns autocommit on this connection on or off.
ac | - true - autocommit is enabled, false - autocommit is disabled |
Implemented in iopc::BasicConnection, and iopc::CachedConnection.