db_bridge/include/postgresql_db.hpp
author Markus Bröker <mbroeker@largo.dyndns.tv>
Wed, 26 May 2010 13:38:53 +0200
changeset 125 9c0fdc119939
parent 65 76514757b0d6
permissions -rw-r--r--
postgresql_db: check connection status During startup, check for a successfull connection to the db committer: Markus Bröker <mbroeker@largo.homelinux.org>

/**
 * db_bridge/include/postgresql_db.h
 * Copyright 2008 (C) Markus Broeker
 */

#ifndef POSTGRESQL_DB_H
#define POSTGRESQL_DB_H

#include <iostream>
#include <abstract_db.hpp>

#include <postgresql/libpq-fe.h>

class PostgreSQL_DB:public Abstract_DB {
  private:
    PGconn * conn;
    PGresult *res;
    std::string conninfo;

  public:
    PostgreSQL_DB (std::string, std::string, std::string, std::string);
    virtual ~ PostgreSQL_DB ();
    bool connect ();
    Abstract_DB::DB_RESULT query (std::string);
};
#endif