author | Markus Bröker <mbroeker@largo.dyndns.tv> |
Thu, 28 May 2009 16:51:26 +0200 | |
changeset 95 | d2a071bd1a60 |
parent 65 | 76514757b0d6 |
permissions | -rw-r--r-- |
65
76514757b0d6
GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
1 |
/** |
76514757b0d6
GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
2 |
* db_bridge/include/postgresql_db.h |
76514757b0d6
GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
3 |
* Copyright 2008 (C) Markus Broeker |
76514757b0d6
GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
4 |
*/ |
76514757b0d6
GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
5 |
|
76514757b0d6
GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
6 |
#ifndef POSTGRESQL_DB_H |
76514757b0d6
GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
7 |
#define POSTGRESQL_DB_H |
76514757b0d6
GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
8 |
|
76514757b0d6
GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
9 |
#include <iostream> |
76514757b0d6
GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
10 |
#include <abstract_db.hpp> |
76514757b0d6
GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
11 |
|
76514757b0d6
GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
12 |
#include <postgresql/libpq-fe.h> |
76514757b0d6
GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
13 |
|
76514757b0d6
GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
14 |
class PostgreSQL_DB:public Abstract_DB { |
76514757b0d6
GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
15 |
private: |
76514757b0d6
GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
16 |
PGconn * conn; |
76514757b0d6
GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
17 |
PGresult *res; |
76514757b0d6
GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
18 |
std::string conninfo; |
76514757b0d6
GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
19 |
|
76514757b0d6
GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
20 |
public: |
76514757b0d6
GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
21 |
PostgreSQL_DB (std::string, std::string, std::string, std::string); |
76514757b0d6
GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
22 |
virtual ~ PostgreSQL_DB (); |
76514757b0d6
GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
23 |
bool connect (); |
76514757b0d6
GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
24 |
Abstract_DB::DB_RESULT query (std::string); |
76514757b0d6
GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
25 |
}; |
76514757b0d6
GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
26 |
#endif |