librpg - A other portgres-c++ - Interface
Class PgConnection
Description
It maintains a contains a connection to the postgres-database.
Interface
Konstructors,Destructors
- PgConnection()
- The default constructor
- PgConnection(const char* conninfo);
- it calls connect
and throws a PgException, if the connection is bad.
- ~PgConnection()
- the destructor closes the Connection
- ConnStatusType Connect(const char* conninfo);
- calls mainly PQconnectdb(conninfo), which use reasonable & environment defaults
- reset()
- calls PQreset, which cleses the connection and opens it again.
Query of the Configuration
These are simply wrappers to the libpq-functions:
- const char* DBName()
- returns name of the database. It calls PQdb from the libpq.
- const char* user()
- calls libpq-function PQuser
- const char* pass()
- calls libpq-function PQpass
- const char* host()
- calls libpq-function PQhost
- const char* port()
- calls libpq-function PQport
- const char* tty()
- calls libpq-function PQtty
- const char* options()
- calls libpq-function PQoptions
- int backendPID()
- calls libpq-function PQbackendPID
Subbmitting SQL-Commands
- void ExecCommand(const char* query,...);
- it is for SQL-commands, where no tuple result is expected.
The string query is processed by sprintf. A PgException is thrown
when a error occurs.
- PGresult* ExecRetTuples(const char* query,...);
- This is for SQL-Commands, where a tuple result is expected.
The string query is processed by sprintf. A PgException is thrown
when a error occurs.
Computerscience and Networkassocation Ravensburg e.V Rudolf Weber