|Oracle9i OLAP Developer's Guide to the OLAP API
Release 2 (9.2)
Part Number A95297-01
Introduction to the OLAP API, 6 of 6
An application that uses the OLAP API typically performs the following tasks:
The rest of this topic briefly describes these tasks, and the rest of this guide provides detailed information.
An application connects to the data store by identifying some information about the target Oracle database and specifying this information in a JDBC connection method.
For more information about connecting, see Chapter 3, "Connecting to a Data Store".
Having established a connection, the application creates an
MdmMetadataProvider. This object gives access to all the metadata objects in the data store.
To discover the available metadata, an application uses the
getRootSchema method on the
MdmMetdataProvider to obtain the top-level measure folder for all of its metadata objects. The application then gets the dimensions, measures, and subfolders that are under the root. Once the application has all the dimensions and measures, it can interrogate them to get their attributes, hierarchies, levels, and other characteristics.
Having determined the metadata objects that it has to work with, the application can present relevant lists of objects to the user for data selection and manipulation.
For a description of the metadata objects, see Chapter 2, "Understanding OLAP API Metadata". For information about how an application can discover the available metadata, see Chapter 4, "Discovering the Available Metadata".
The heart of any OLAP application lies in the construction of queries against the data store. The application user interface provides ways for the user to select data and specify what should be done with it. Then, the data manipulation code translates these instructions into queries against the data store. The queries can be as simple as a selection of dimension elements, or they can be complex, including several aggregations and calculations on measure values.
The OLAP API object that specifies a query is a
Source. Therefore, a significant portion of any OLAP API application is devoted to dealing with
You can manipulate
Source objects directly, using methods such as
appendValues to create selections. In addition, you can use methods such as
total to calculate values.
Source and its subclasses,
BooleanSource, have a rich assortment of methods for manipulating data. The most powerful method in
join, which gives you the ability to combine
Source objects in almost any way imaginable.
If you are implementing a simple user interface, you might use only the methods on the
Source classes to select and manipulate the data that users specify in the interface. However, if you want to offer your users multistep selection procedures and the ability to modify queries or undo individual steps in their selections, you should use
Template classes as described in the topic "Developing an OLAP API Application" . Within the code for each
Template, you use the methods on the
Source classes, but the
Template classes themselves allow you to modify and refine even the most complex query. In addition, you can minimize your work by writing general-purpose
Template classes and reusing them in various parts of your application.
When users of an OLAP application are selecting, calculating, combining, and generally manipulating data, they also want to see the results of their work. This means that the application must retrieve the result sets of queries from the data store and display the data in multidimensional form. To retrieve a result set for a query through the OLAP API, the application creates a
Cursor based on the
Source that specifies the query.
Because the OLAP API was designed to deal with a multidimensional view of data, a
Source can have a multidimensional result set. For example, a
Source can represent an
MdmMeasure that is structured by three
MdmDimension objects. The
Cursor for this
Source has a structure that mirrors the
Source itself; that is, the
Cursor organization is based on the same three
To retrieve all the items of data through a
Cursor, the application can loop through the multidimensional
Cursor structure. This design is well adapted to the requirements of standard user interface objects for painting the computer screen. It is especially well adapted to the display of data in multidimensional format.
For more information about using
Cursor objects to retrieve data, see Chapter 8, "Understanding Cursor Classes and Concepts".