diff options
| author | Bruce Momjian <bruce@momjian.us> | 1999-05-23 01:04:07 +0000 |
|---|---|---|
| committer | Bruce Momjian <bruce@momjian.us> | 1999-05-23 01:04:07 +0000 |
| commit | b14c99d8d6bdb3155fe54e6f24e8aac32a09ed81 (patch) | |
| tree | 0b63fc00dfff28c643cfafe587777ab11e5733c5 /src/interfaces/libpq++/pgconnection.h | |
| parent | 795f6ca66ab734559e6eed7a9466eb19b58f3166 (diff) | |
| download | postgresql-b14c99d8d6bdb3155fe54e6f24e8aac32a09ed81.tar.gz | |
Here it is. Remove or rename the current interfaces/libpq++ and untar
this file in interfaces/
It will all need to be checked in. I used the char *rcsid[] method for
cvs ids so it can be strings | grep'd to find version numbers. The new
version for the library is 3.0.
Run configure from src/ to create the Makefile and it should be good to
go.
I did minimal documentation references in the README, I'll see if I can
get something to Tom Lockhart rather quickly.
Vince.
Diffstat (limited to 'src/interfaces/libpq++/pgconnection.h')
| -rw-r--r-- | src/interfaces/libpq++/pgconnection.h | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/interfaces/libpq++/pgconnection.h b/src/interfaces/libpq++/pgconnection.h index 125c9427a5..c265bb833b 100644 --- a/src/interfaces/libpq++/pgconnection.h +++ b/src/interfaces/libpq++/pgconnection.h @@ -11,6 +11,8 @@ * Currently under construction. * * Copyright (c) 1994, Regents of the University of California + * + * $Id: pgconnection.h,v 1.2 1999/05/23 01:04:00 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -19,7 +21,7 @@ #define PGCONN_H #include <stdio.h> -#include "pgenv.h" +#include <string> extern "C" { #include "libpq-fe.h" @@ -36,25 +38,21 @@ extern "C" { // derived from this class to obtain the connection interface. class PgConnection { protected: - PgEnv pgEnv; // Current connection environment PGconn* pgConn; // Connection Structures PGresult* pgResult; // Query Result - string pgErrorMessage; // Error messages container int pgCloseConnection; // Flag indicating whether the connection should be closed or not public: - PgConnection(const char* dbName); // use reasonable defaults - PgConnection(const PgEnv& env, const char* dbName); // connect to the database with - // given environment and database name - virtual ~PgConnection(); // close connection and clean up + PgConnection(const char* conninfo); // use reasonable & environment defaults + ~PgConnection(); // close connection and clean up // Connection status and error messages ConnStatusType Status(); - int ConnectionBad() { return Status() == CONNECTION_BAD; } - const char* ErrorMessage() const { return pgErrorMessage.c_str(); } + int ConnectionBad(); + const char* ErrorMessage(); // returns the database name of the connection - const char* DBName() const { return PQdb(pgConn); } + const char* DBName(); // Query Execution interface ExecStatusType Exec(const char* query); // send a query to the backend @@ -63,13 +61,11 @@ public: PGnotify* Notifies(); protected: - ConnStatusType Connect(const char* dbName); - void SetErrorMessage(const string&, int append = 0); + ConnStatusType Connect(const char* conninfo); string IntToString(int); protected: PgConnection(); - PgConnection(const PgConnection&); }; #endif // PGCONN_H |
