A class that implements a connection to a PostgreSQL database.
More...
#include <Connection.h>
A class that implements a connection to a PostgreSQL database.
This class models a physical connection to a PostgreSQL data source. It is designed to work with the connection pool.
- See also
- ConnectionPool
Definition at line 68 of file Connection.h.
te::pgis::Connection::~Connection |
( |
| ) |
|
te::pgis::Connection::Connection |
( |
ConnectionPool * |
pool, |
|
|
const std::string & |
conninfo, |
|
|
const std::string & |
cencoding, |
|
|
bool |
inuse = false |
|
) |
| |
|
private |
Constructor.
- Parameters
-
pool | The associated connection pool. |
conninfo | A coonection string as undertood by libpq. |
cecoding | The character encoding used by application. |
inuse | A marker that tells if the connection is in use or not. |
void te::pgis::Connection::execute |
( |
const std::string & |
command | ) |
|
It executes the given SQL command and throws away the result.
- Parameters
-
- Exceptions
-
Exception | It throws an exception if the query execution fails. |
PGconn* te::pgis::Connection::getConn |
( |
| ) |
const |
|
inline |
It gets the underlying PGconn object.
- Returns
- The underlying PGconn object.
Definition at line 97 of file Connection.h.
It gets the associated connection pool.
- Returns
- The associated connection pool.
Definition at line 107 of file Connection.h.
PGresult* te::pgis::Connection::query |
( |
const std::string & |
query | ) |
|
It queries the database.
- Parameters
-
query | A SQL Select command. |
- Returns
- A resultset. The caller of this method will take its ownership.
- Exceptions
-
Exception | It throws an exception if the query execution fails. |
bool te::pgis::Connection::m_inuse |
Tells if the connection is in use or not.
Definition at line 131 of file Connection.h.
boost::posix_time::ptime te::pgis::Connection::m_lastuse |
It marks the last time this connection was used.
Definition at line 132 of file Connection.h.
PGconn* te::pgis::Connection::m_pgconn |
The PostgreSQL real connection handle.
Definition at line 130 of file Connection.h.
The connection pool associated to the connection.
Definition at line 129 of file Connection.h.
The documentation for this class was generated from the following file:
- /home/castejon/castejon_files/develop/terralib5/git_master/terralib5/src/terralib/postgis/Connection.h