All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
te::ado::Connection Class Reference

A class that implements a connection to a ADO database. More...

#include <Connection.h>

Inheritance diagram for te::ado::Connection:

Public Member Functions

 Connection (const std::string &conninfo)
 Constructor. More...
 
void execute (const std::string &command)
 It executes the given SQL command and throws away the result. More...
 
_ConnectionPtr getConn () const
 It gets the ADO Connection object. More...
 
bool isValid ()
 
_RecordsetPtr query (const std::string &query, bool connected=false)
 It queries the database. More...
 
 ~Connection ()
 Destructor. More...
 

Public Attributes

_ConnectionPtr m_conn
 The ADO real connection handle. More...
 

Friends

class ConnectionPool
 

Detailed Description

A class that implements a connection to a ADO database.

This class models a physical connection to a ADO data source. It is designed to work with the connection pool.

See also
ConnectionPool

Definition at line 60 of file Connection.h.

Constructor & Destructor Documentation

te::ado::Connection::Connection ( const std::string &  conninfo)

Constructor.

Parameters
conninfoA coonection string as undertood by ADO.
inuseA marker that tells if the connection is in use or not.

Definition at line 44 of file Connection.cpp.

References m_conn, TE_TR, and TESTHR().

te::ado::Connection::~Connection ( )

Destructor.

Definition at line 82 of file Connection.cpp.

Member Function Documentation

void te::ado::Connection::execute ( const std::string &  command)

It executes the given SQL command and throws away the result.

Parameters
commandAny SQL command.
Exceptions
ExceptionIt throws an exception if the query execution fails.

Definition at line 114 of file Connection.cpp.

References TE_TR.

_ConnectionPtr te::ado::Connection::getConn ( ) const
inline

It gets the ADO Connection object.

Returns
The ADO Connection object.

Definition at line 102 of file Connection.h.

bool te::ado::Connection::isValid ( )

Definition at line 128 of file Connection.cpp.

_RecordsetPtr te::ado::Connection::query ( const std::string &  query,
bool  connected = false 
)

It queries the database.

Parameters
queryA SQL Select command.
Returns
A resultset. The caller of this method will take its ownership.
Exceptions
ExceptionIt throws an exception if the query execution fails.

Definition at line 91 of file Connection.cpp.

References TE_TR, and TESTHR().

Friends And Related Function Documentation

friend class ConnectionPool
friend

Definition at line 111 of file Connection.h.

Member Data Documentation

_ConnectionPtr te::ado::Connection::m_conn

The ADO real connection handle.

Definition at line 109 of file Connection.h.

Referenced by Connection().


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