Oracle® Objects for OLE C++ Class Library Developer's Guide 10g Release 2 (10.2) Part Number B14308-01 |
|
Applies To
Description
This method creates a pool of database connections.
Usage
oresult CreateDatabasePool (long initSize, long maxSize, long timeOut, const char *dbname, const char *username, const char *pwd, long options = ODATABASE_DEFAULT);
Arguments
Arguments |
Description |
---|---|
initSize | Number of connections to be created at the beginning. |
maxSize | Maximum number of connections in the pool. |
timeOut | Amount of time an unused connection will be active |
dbname | The name of the database to which you want to connect |
username | The username you wish to use to log in to the database |
pwd | The database password for the user username |
options | Options to create the database object |
Only one pool can be created for each session. An OIP error 4147-Database Pool Already exists for this session will be generated if CreateDatabasePool is called again.
Return Value
An oresult indicating whether the operation succeeded (OSUCCESS) or not (OFAILURE).
Example
This example creates a pool of 2 connections with a maximum of 10 connections:
OSession osess; osess.Open(); osess.CreateDatabasePool(2,10,200, "Exampledb", "scott", "tiger", ODATABASE_DEFAULT);