Data Access and SQL > Connecting to a Database > Registered Sessions
 
Registered Sessions
When you use the Rogue Wave® Views Studio editor to create the panels of an application, you can define application-wide sessions and then specify one or more SQL data sources that share the same session. An application-wide session is, in fact, a registered session object.
The RegisterSession member function registers a session object. This is shown in the following code excerpt:
IliSQLSession* session;
session = new IliSQLSession(“oracle10”, “scott/@options”);
session->setSessionName(“MainSession”);
IliSQLSession::RegisterSession(session);
Alternatively, a session can be registered using the following code:
IliSQLSession::RegisterSession(“MainSession”,
“oracle10”,
“scott/@options”)
The GetRegisteredSession member function can be used to retrieve a registered session:
IliSQLSession* session =
IliSQLSession::GetRegisteredSession(“MainSession”);

Version 5.5.1
Copyright © 2012, Rogue Wave Software, Inc. All Rights Reserved.