Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

pqxx::connection Class Reference

Connection class; represents an immediate connection to a database. More...

#include <connection.hxx>

Inheritance diagram for pqxx::connection:

pqxx::connection_base List of all members.

Public Member Functions

 connection ()
 Constructor. Sets up connection without connection string.
 connection (const PGSTD::string &ConnInfo)
 Constructor. Sets up connection based on PostgreSQL connection string.
 connection (const char ConnInfo[])
 Constructor. Sets up connection based on PostgreSQL connection string.
virtual ~connection () throw ()

Detailed Description

Connection class; represents an immediate connection to a database.

This is the class you typically need when you first work with a database through libpqxx. Its constructor immediately opens a connection. Another option is to defer setting up the underlying connection to the database until it's actually needed; the lazyconnection class implements such "lazy" behaviour. Most of the documentation that you'll need to use this class is in its base class, connection_base.

The advantage of having an "immediate" connection (represented by this class) is that errors in setting up the connection will probably occur during construction of the connection object, rather than at some later point further down your program.

This class is a near-trivial implementation of the connection_base interface defined in connection_base.hxx. All features of any interest to client programmers are defined there.


Constructor & Destructor Documentation

pqxx::connection::connection  ) 
 

Constructor. Sets up connection without connection string.

Only default values will be used, or if any of the environment variables recognized by libpq (PGHOST etc.) are defined, those will override the defaults.

pqxx::connection::connection const PGSTD::string &  ConnInfo  )  [explicit]
 

Constructor. Sets up connection based on PostgreSQL connection string.

Parameters:
ConnInfo A PostgreSQL connection string specifying any required parameters, such as server, port, database, and password. These values override any environment variables that may have been set for the same parameters.
The README file for libpqxx gives a quick overview of how connection strings work; see the PostgreSQL documentation (particularly for libpq, the C-level interface) for a complete list.

pqxx::connection::connection const char  ConnInfo[]  )  [explicit]
 

Constructor. Sets up connection based on PostgreSQL connection string.

Parameters:
ConnInfo A PostgreSQL connection string specifying any required parameters, such as server, port, database, and password. As a special case, a null pointer is taken as the empty string.
The README file for libpqxx gives a quick overview of how connection strings work; see the PostgreSQL documentation (particularly for libpq, the C-level interface) for a complete list.

pqxx::connection::~connection  )  throw () [virtual]
 


The documentation for this class was generated from the following files:
Generated on Mon Nov 15 11:28:02 2004 for libpqxx by  doxygen 1.3.9.1