iopc::Connection Class Reference
[iopcdb]

Represents a connection to a SQL database. More...

#include <connection.h>

Inheritance diagram for iopc::Connection:

Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual Cursorsql (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 Connectionoperator<< (const std::string &command)=0
 Shortcut for sqlNonQuery.
virtual DatabasegetDatabase ()=0
 Returns the associated Database object.
virtual DrivergetDriver ()=0
 Returns the database driver used.
virtual ConnectionImplgetImplementation ()=0
 Returns the driver-side part of the Connection implemenation.
virtual ConnectiongetBasicConnection ()=0
 Returns the driver-independent part of the Connection implementation.


Detailed Description

Represents a connection to a SQL database.

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.


Member Function Documentation

virtual Cursor* iopc::Connection::sql ( const std::string &  name  )  [pure virtual]

Sends an SQL statement (a query) to an associated database.

Returns:
A Cursor object representing the result set of the SQL command

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.

Parameters:
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.

Parameters:
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.

Parameters:
ac - true - autocommit is enabled, false - autocommit is disabled

Implemented in iopc::BasicConnection, and iopc::CachedConnection.


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

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