BIFrame is a simple application that demonstrates how a BI Beans application can setup a connection to Oracle9i OLAP (the source of the business data for the application) and to the BI Beans Catalog (where object definitions, like crosstabs and graphs, are saved).
BIFrame provides a menu with access to a simple connection dialog that prompts a user for security credentials. BIFrame then makes the two connections described above. This sample is used by the other samples that require the connections.
If you have not already done so, you must perform several installation
and configuration tasks, then open the workspace javaclient\javaclient.jws
under the samples
directory within JDeveloper. All the necessary
files for this sample can be found in the bootstrap.jpr
project
under the javaclient.jws
workspace.
The connect method in the sample shows how connections to Oracle9i OLAP and the Oracle BI Beans Catalog are created. The following section provides a walk-through and explains significant code fragments:
Before setting up the connections, an application must first create a new user session. This is accomplished by creating a new BISession object. A BISession can take the name of a BI Configuration file as an argument. A BI Configuration file is an XML file that contains the definition of the connections.
m_session = new BISession(m_configFile);
In addition, an application must specify the name of the application user.
m_session.setBIUser(new BIUser(userName));
Note that this information could also be specified within the BI Configuration file.
After an application creates a session, it can retrieve the MetadataManager that is associated with the specified connections through the ManagerFactory (since the connection definitions are already defined in the BI Configuration file).
m_metadataManager = (MetadataManager)m_session.getManagerFactory().lookupManager(ManagerFactory.METADATA_MANAGER,
null, true);
An application can also use the ManagerFactory to retrieve the QueryManager that is associated with the MetadataManager.
m_queryManager = (QueryManager)m_session.getManagerFactory().lookupManager(ManagerFactory.QUERY_MANAGER,
null, true);
Finally, if a connection to the BI Beans Catalog is defined in the BI Configuration file, then an application can also retrieve the PersistenceManager through the ManagerFactory.
m_persistenceManager = (PersistenceManager)m_session.getManagerFactory().lookupManager(ManagerFactory.PERSISTENCE_MANAGER,
null, true);
The disconnect method in the sample shows how to disconnect from Oracle9i OLAP and the BI Beans Catalog.
All that the application has to do is to disconnect the current user session by calling the disconnect method on the BISession object
m_session.disconnect();
The connections that are associated with the MetadataManager are automatically disconnected when the user session is disconnected.
To run the BIFrame example within JDeveloper, simply right click on the file BIFrame.java and choose Run BIFrame.java. From the File Menu in the application, choose Connect and enter the username and password of the user that owns the BI Beans Catalog (e.g. BIBCAT).
![]() |
|
---|---|
Copyright © 2002, 2003 Oracle. All Rights Reserved. |
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. |