Skip Headers

Oracle® Objects for OLE C++ Class Library Developer's Guide
Release 9.2.0.4

Part Number B10954-01
Go To Table Of Contents
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 © 1998, 2003 Oracle Corporation.

All Rights Reserved.
Go To Table Of Contents
Contents