![]() |
TerraLib 4.1
|
#include <TeConnectionPool.h>
Public Member Functions | |
| bool | initialize (const std::string &user, const std::string &password, const std::string &host, const std::string &dbName, const std::string &dbmsName, const int &portNumber) |
| Intializes the pool of connections given a set of parameters. | |
| TeConnection * | getConnection () |
| Gets a free connection that can be used for a TeDatabase instance. | |
| void | releaseConnection (TeConnection *conn) |
| Releases the given connection. | |
Constructor | |
Initilizer methods. | |
| TeConnectionPool (const unsigned int &maxConnections, const unsigned int &maxIdle=0, const clock_t &maxWait=10000) | |
| Constructor. | |
| ~TeConnectionPool () | |
| Destructor. | |
Access method. | |
Method to access the pool attrbiutes. | |
| void | setTimeOut (const clock_t t) |
| Sets the time limit to wait for a connection (in milliseconds). | |
| TeConnectionPool::TeConnectionPool | ( | const unsigned int & | maxConnections, |
| const unsigned int & | maxIdle = 0, |
||
| const clock_t & | maxWait = 10000 |
||
| ) |
Constructor.
| nConns | The number of connections that will be controlled by the pool. |
| timeOut | Time limit to wait for a connection (in milliseconds). |
| TeConnectionPool::~TeConnectionPool | ( | ) |
Destructor.
| TeConnection * TeConnectionPool::getConnection | ( | ) |
Gets a free connection that can be used for a TeDatabase instance.
| bool TeConnectionPool::initialize | ( | const std::string & | user, |
| const std::string & | password, | ||
| const std::string & | host, | ||
| const std::string & | dbName, | ||
| const std::string & | dbmsName, | ||
| const int & | portNumber | ||
| ) |
Intializes the pool of connections given a set of parameters.
| user | The database user. |
| password | The user password. |
| host | The database host. |
| dbName | The database name. |
| dbmsName | The database manager system name (i.e. PostgreSQL, Access). |
| portNumber | The database port. |
| void TeConnectionPool::releaseConnection | ( | TeConnection * | conn | ) |
Releases the given connection.
| void TeConnectionPool::setTimeOut | ( | const clock_t | t | ) |
Sets the time limit to wait for a connection (in milliseconds).