Oracle Objects for OLE C++ Class Library
Release 9.0.1

Part Number A90172-01

Home

Book List

Contents

Master Index

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

}


 
Oracle
Copyright © 1996-2001, Oracle Corporation.

All Rights Reserved.

Home

Book List

Contents