Oracle® Objects for OLE Developer's Guide 11g Release 2 (11.2) for Microsoft Windows Part Number E17727-03 |
|
|
PDF · Mobi · ePub |
Creates a pool of OraDatabase
objects. Only one pool can be created for each OraSession
object.
CreateDatabasePool (long initialSize, long maxSize, long timeoutValue, BSTR database_name, BSTR connect_string, long options)
The arguments for the method are:
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 is disconnected. The connection is reopened if the pool item is used again. This value is in seconds. |
database_name |
The Oracle network specifier used when connecting the data control to a database. |
connectString |
The user name and password to be used when connecting to an Oracle database. |
options |
A bit flag word used to set the optional modes of the database. If options = 0 , the default mode settings apply. "Constants" shows the available modes. |
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 Oracle Database.
Invalid values for arguments are passed (that is, initialSize
> maxSize
).
The LastServerErr
property of the OraSession
object contains 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.