Chapter 2. libpq++ - C++ Binding Library

libpq++ is a set of classes that enable client programs to connect to the Red Hat Database backend server. This library encapsulates the libpq C library to make life easier for C++ programmers. Consequently, most of the operational details are established by libpq, so there will be references to the Chapter 1 chapter.

Note

With proper care, a C++ program can use libpq directly, as libpq++ actually does. (Look at the header files in the libpq++ source code for details on how this can be done.)

PGConnection

The PgConnection class represents a connection to the database. If you are only sending simple queries that do not return any data, this is all that you need. However, it is recommended that you use PgDatabase instead. Even in that case, the methods of PgConnection (discussed below) will be used through inheritance.