Database Reference
In-Depth Information
// disconnect from the server
server.disconnect();
if (essbase != null && essbase.isSignedOn())
// mark the IEssbase object as signed off
essbase.signOff();
} catch (EssException e) {
// again, simplistic exception handling
e.printStackTrace(System.out);
}
}
So far in this chapter, we have discussed some of the Essbase objects available in the
Java API and have learned how to use those objects to connect to an Essbase database.
In the next section, we will discuss how to retrieve data from Essbase.
8.4 retrieving Data From essBase
The primary reason for anyone to use Essbase is to store data that users can later retrieve
into their spreadsheets. For nearly every Essbase user, this seems to be a fairly easy task.
using Smart view, they can connect to the database of their choice, double-click on the
worksheet, and have that worksheet populated by Essbase data. users with Essbase expe-
rience may be able to lay out their own Essbase reports by typing Essbase member names
into the worksheet. This query-by-example methodology is unique to Essbase and uses a
subsection of the API commonly known as the “grid API.” The grid API is an integral
part of the Java API. you can think of the grid used in the Java API as an invisible work-
sheet. The grid used in Java API is provided by an instance of the IEssGridView interface.
one of the main differences is that, instead of typing members into the worksheet, you
will use Java methods to place the member values in the appropriate cells of the grid.
The standard tasks required to return data from Essbase using the Java API include:
•  obtain a connection to the desired Essbase cube.
•  open an instance of an IEssCubeView object from the cube.
•  get the IEssGridView instance associated with the given IEssCubeView instance.
•  Set the values of cells to the desired member names using the standard Essbase
layout rules.
•  Set the desired Essbase options on the IEssCubeView.
•  Create an instance of an IEssOperation object.
•  Set any property values required by the operation.
•  Perform the operation on the IEssCubeView.
•  read the data placed into the IEssGridView by the Essbase operation.
It seems like there are many steps required just to do a simple retrieve, but it really
is not too bad once you start writing the code, so let us just dive in and get started. As
we already covered connecting to Essbase in the last section, let us start by opening an
instance of the cubeview object.
// get the cubeview
IEssCubeView cv = cube.openCubeView("default");
The cubeview instance is returned by the openCubeView method, which has a single
argument to pass the cubeview name. The name appears to serve as a unique identifier
Search WWH ::




Custom Search