|
The SDK package delivers source code for several examples of using
the Relational and OLAP APIs of the BI Java SDK. This page allows
you to view the source and result of each example, and explains
how to configure your system to work with the examples, in the following
sections:
Viewing the Examples
Following the links in the table below, you can view the source
code and code comments of the example Java files reproduced in HTML
format ("view source"). You may also view the HTML stream of the
result ("view result").
The example and properties files are located in the docs/examples
folder after unzipping the SDK archive, and the links below reflect
that location. The two Tutorial examples form the basis for the
Getting Started chapter in the Developer's
Guide ( ).
Tutorial_1.java:
view
source
view
result |
Getting Started - OLAP Tutorial
Contains a complete end-to-end scenario, demonstrating how to
connect to a BW system using the BI XMLA Connector, retrieve
a cube from the data source, create a query, execute it, and
render the result set into an HTML table. |
Tutorial_2.java:
view
source
view
result |
Getting Started - Relational Tutorial
Contains a complete end-to-end scenario, demonstrating how to
connect to a JDBC database using the BI JDBC Connector, retrieve
a table from the data source, create a query, execute it, and
render the result set into an HTML table. |
Olap_1.java:
view
source
view result
|
OLAP 1 - Accessing OLAP metadata
Demonstrates four different ways to retrieve OLAP metadata:
- via connection-level methods
- via ObjectFinder methods
- via JMI methods
- via member data access methods
|
Olap_2.java:
view
source
view result
|
OLAP 2 - Direct execution of MDX statement
Demonstrates how to retrieve a result set by directly executing
an MDX statement, then shows how to display the result set as
an HTML table. |
Olap_3.java:
view
source
view result
|
OLAP 3 - Pivoting / changing layout of an
OLAP query
Illustrates the process of changing the layout of a query by
moving dimensions between axes and then by swapping axes. Renders
the output of each into two separate HTML tables. |
Olap_4.java:
view
source
view result
|
OLAP 4 - Selecting dimension attributes
Selects a dimension attribute, and renders the result set into
an HTML table. |
Olap_5.java:
view
source
view result
|
OLAP 5 - Sorting by measure value
Renders the default result set into an HTML table, sorts the
data according to a measure value in ascending order, and then
renders the data into a second HTML table for comparison. |
Olap_6.java:
view
source
view result
|
OLAP 6 - Sorting by dimension attribute
Illustrates how to select a dimension attribute for display,
and to sort by a dimension attribute. |
Olap_7.java:
view
source
view result
|
OLAP 7 - Filtering
Illustrates both a ranking filter and a condition-based filter.
Renders the result of a query without any filtering, then filters
the set of Sold-To parties using a ranking filter and re-renders
the result. Changes the filter to a condition-based filter to
restrict by quantity, and re-renders the result for comparison. |
Olap_8.java:
view
source
view result
|
OLAP 8 - Hierarchy navigation - member
drill operations
Illustrates hierarchy navigation by applying the following operations
in sequence to an initial data set:
- zoom in
- zoom out
- drill down
- drill up
After each operation, the result set is rendered again for comparison.
|
Olap_9.java:
view
source
view result
|
OLAP 9 - Calculated members
Creates a calculated measure - cost per item - by dividing the
total cost by the number of items sold. |
Olap_10.java:
view
source
view
result |
OLAP 10 - SAP variable selection and editing
Illustrates retrieval of and effect of editing an SAP variable.
Sets a value for an optional SAP variable, renders the result
of the default query into a table, searches for a specific optional
SAP variable using the OLAP object finder, changes its value,
and then re-renders the result into a new table for comparison. |
Relational_1.java:
view
source
view
result |
Relational 1 - Accessing relational metadata
Illustrates the process of retrieving relational metadata from
catalog to column from a JDBC data source. |
Relational_2.java:
view
source
view
result |
Relational 2 - Accessing relational metadata:
2
Demonstrates three different ways to retrieve relational metadata:
- via connection-level methods
- via ObjectFinder methods
- via JMI methods
|
Relational_3.java:
view
source
view
result |
Relational 3 - Direct execution of SQL statement
Demonstrates how to retrieve a result set by directly executing
a SQL statement, then shows how to display the result set as
an HTML table. |
Relational_4.java:
view
source
view
result |
Relational 4 - Simple relational query
Demonstrates how to retrieve a result set by creating a simple
query, then shows how to display the result set as an HTML table. |
Relational_5.java:
view
source
view
result |
Relational 5 - More complex relational
query
Demonstrates how to retrieve a result set by creating a more
complex query with the following features:
- field selections
- joins
- sorting
|
Helpers.java:
view
source |
Helper methods
Provides static helper methods that facilitate connecting to
data sources and rendering result sets. |
Configuring your System
First, be sure you've consulted the SDK Installation
instructions, and then follow with the sections below to get up
and running with the examples.
Data Sources
You can view the example source and result on this page, but to
actually work with and run the examples, you need the following
data sources:
Rendering to File
These examples implement a minimal HTTP servlet, which generates
HTML for easy viewing of results. By default, running the main
method without a parameter will write the HTML to the console. To
write it to an HTML file instead, specify a filename, with full
path and .html extension, as the parameter.
Connection Properties
Four properties files, one for each BI Java Connector, provide
connection properties to the connectors and are included in the
examples folder:
Edit the existing files, or create new files to locally override
the properties, named Helpers.nnnn.local.properties
(where "nnnn" corresponds to the four-letter connector
name). The examples will first look for the local file, and if not
found, will take the original properties files.
For connection configuration information, refer to the howto.html
file that ships inside of each resource adapter archive. The connectors'
howto.html files are also included in this distribution
package for your reference, accessible from the Connectors
page.
For Additional Information
- These examples are referred to in the Developer's
Guide (
);
the Tutorial examples form the basis for the Getting Started chapter.
- Refer to the Connectors page for
more information about the BI Java Connectors.
Copyright © 2004-2005 by SAP
AG. All Rights Reserved.
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other
SAP products and services mentioned herein as well as their respective
logos are trademarks or registered trademarks of SAP AG in Germany
and in several other countries all over the world. All other product
and service names mentioned are the trademarks of their respective
companies. Data contained in this document serves informational
purposes only. National product specifications may vary.
These materials are subject to change without notice. These materials
are provided by SAP AG and its affiliated companies ("SAP Group")
for informational purposes only, without representation or warranty
of any kind, and SAP Group shall not be liable for errors or omissions
with respect to the materials. The only warranties for SAP Group
products and services are those that are set forth in the express
warranty statements accompanying such products and services, if
any. Nothing herein should be construed as constituting an additional
warranty.
|