Oracle Objects for OLE C++ Class Library
Release 8.1.7

Part Number A85258-01

Library

Product

Contents

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());

}


 
Oracle
Copyright copy; 1996-2000, Oracle Corporation.

All Rights Reserved.

Library

Product

Contents