Skip Headers

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

Part Number B10119-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

GetConnections Method

Applies To

OSession

Description

This method returns an OConnectionCollection object that contains the connections of the session.

Usage

OConnectionCollection GetConnections(void) const

Remarks

A session can have multiple connections associated with it. If you are interested in finding out about the connections of a session as a group, call GetConnections.

Return Value

An OConnectionCollection, which will be open on success, closed on failure.

Example

This example prints out to a file all the database names in the current session.

// we assume an already open FILE * named ofile

// construct and open an OSession on the default session

OSession defsess(0);

// get the connections

OConnectionCollection ccoll = defsess.GetConnections();

// look through all of them

int ii;

for (ii=0; ii<ccoll.GetCount(); ii++)

{ // for each connection, print the database name

fprintf(ofile, "%s\n", ccoll.GetConnection(ii).GetDatabaseName());

}