Skip Headers

Oracle® Objects for OLE Developer's Guide
10g Release 1 (10.1)

Part Number B10118-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Master Index
Master Index
Go to Feedback page
Feedback

CreateDatabasePool Method

See Also

Applies To

OraSession

Description

This method creates a pool of OraDatabase objects. Only one pool can be created for each OraSession.

Usage

CreateDatabasePool (long initialSize, long maxSize, long timeoutValue, BSTR connectString, BSTR usernamePassword, long options)

Arguments
Description
initialSize
the Initial Size of the pool
maxSize
the maximum size to which the pool can grow
timeoutValue
if an OraDatabase object in the pool is idle for the timeoutValue value specified, the database connection that it contains will be disconnected. The connection will be reopened if the pool item is used again. This value is in seconds.
connectString, usernamePassword, and options are the same parameters used in the OpenDatabase method of OraSession.

Remarks

The OpenDatabase method of the OraSession object is used to establish a connection to an Oracle database. This method returns a reference to the OraDatabase object which is then used for executing SQL statements and PL/SQL blocks. The Connection Pool in OO4O is a pool of OraDatabase objects. The pool is created by invoking the CreateDatabasePool method of the OraSession interface.

Exceptions are raised by this call if:

· a pool already exists

· an error occurs in creating a connection to the Oracle database

· invalid values for arguments are passed (that is initialSize > maxSize)

The LastServerErr property of OraSession will contain the code for the specific cause of the exception resulting from an Oracle database error.

One possible connection error that could be returned is:

ORA-28001 "the password has expired"

The user can change the password using the ChangePassword method.