Oracle C++ Call Interface Programmer's Guide Release 2 (9.2) Part Number A96583-01 |
|
OCCI Classes and Methods, 7 of 22
The ConnectionPool class represents a pool of connections for a specific database.
To create a connection pool, use the syntax:
ConnectionPool();
This method creates a pooled connection.
Connection* createConnection(const string &userName, const string &password);
The name of the user to connect as.
The password of the user.
This method creates a proxy connection from the connection pool.
There are variants of syntax:
Connection* createProxyConnection(cont string &name, Connection::ProxyType proxyType = Connection::PROXY_DEFAULT);
Connection* createProxyConnection(const string &name, string roles[], int numRoles, Connection::ProxyType proxyType = Connection::PROXY_DEFAULT);
The user name to connect with.
The roles to activate on the database server.
The number of roles to activate on the database server.
The type of proxy authentication to perform.
Valid values are:
PROXY_DEFAULT
representing a database user name.
PROXY_EXTERNAL_AUTH
representing an external user name.
This method returns the number of busy connections in the connection pool.
unsigned int getBusyConnections() const;
This method returns the number of incremental connections in the connection pool.
unsigned int getIncrConnections() const;
This method returns the maximum number of connections in the connection pool.
unsigned int getMaxConnections() const;
This method returns the minimum number of connections in the connection pool.
unsigned int getMinConnections() const;
This method returns the number of open connections in the connection pool.
unsigned int getOpenConnections() const;
This method returns the name of the connection pool.
string getPoolName() const;
This method returns the time-out period of a connection in the connection pool.
unsigned int getTimeOut() const;
This method specifies that a SQLException is to be generated when all connections in the connection pool are busy and no further connections can be opened.
void setErrorOnBusy();
This method sets the minimum, maximum, and incremental number of pooled connections for the connection pool.
void setPoolSize(unsigned int minConn = 0, unsigned int maxConn = 1, unsigned int incrConn = 1);
The minimum number of connections for the connection pool.
The maximum number of connections for the connection pool.
The incremental number of connections for the connection pool.
This method sets the time-out period for a connection in the connection pool. OCCI will terminate any connections related to this connection pool that have been idle for longer than the time-out period specified.
void setTimeOut(unsigned int connTimeOut = 0);
The time-out period in number of seconds.
This method terminates the pooled connection or proxy connection.
void terminateConnection(Connection *connection);
The pooled connection or proxy connection to terminate.
|
Copyright © 2001, 2002 Oracle Corporation. All Rights Reserved. |
|