Oracle Objects for OLE C++ Class Library
Release 9.2

Part Number A95896-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents

Master Index

Feedback

GetNamedSession Method

Applies To

OSession

Description

This method returns the session with the specified name by way of an OSession handle.

Usage

static OSession GetNamedSession(const char *sname)

Arguments

sname
The name of the desired session.
Remarks

When sessions are created they are given a name. The GetNamedSession enables you to get a session based on that name. It is not possible to share sessions across applications, only within applications.

This routine is static, so it does not have to be invoked on an OSession object. It can be invoked as "OSession::GetNamedSession".

You can obtain the application's default session by passing a NULL for sname.

Return Value

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

Example

Getting sessions by name:

// we can obtain the default session:

OSession defsess = OSession::GetNamedSession(0);

// or we can get a session by name.

// Let's create a session by name:

OSession newsess;

newsess.Open("sessname");

// now go get that session

OSession newscopy = OSession::GetNamedSession("sessname");

// by the way

oboolen isequal = (newscopy == newsess);

// isequal is TRUE


 
Oracle
Copyright © 1998, 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents

Master Index

Feedback