Samples Tutorial

     Previous  Next    Open TOC in new window    View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

Consuming Data Services through JDBC/SQL

Data Services Platform JDBC driver gives JDBC clients read-only access to the information supplied by data services. With the Data Services Platform JDBC driver, ALDSP acts as a virtual database. The driver allows you to invoke data service functions from any JDBC client, from custom Java applications to database, and from reporting tools, including Crystal Reports.

 


Objectives

After completing this lesson, you will be able to:

 


Overview

Data services built into ALDSP can be accessed using the Data Services Platform JDBC driver, which provides access to the ALDSP-enabled Server via JDBC APIs. With this functionality, JDBC clients—including business intelligence and reporting tools such as Business Objects and Crystal Reports—are granted read-only access to the information supplied by ALDSP services. The main features of the Data Services Platform JDBC driver are:

When communicating with ALDSP via a JDBC/ODBC interface, standard SQL-92 query language is supported. The Data Services Platform JDBC driver implements components of the java.sql.* interface, as specified in JDK 1.4x.

Data Services Platform JDBC driver gives JDBC clients read-only access to the information supplied by data services. With the Data Services Platform JDBC driver, ALDSP acts as a virtual database. The driver allows you to invoke data service functions from any JDBC client, from custom Java applications to database, and from reporting tools, including Crystal Reports.

 


12.1 Running DBVisualizer

WebLogic Platform includes DBVisualizer, which is a third-party database tool designed to simplify database development and management.

Before you start:

Objectives

In this exercise, you will:

Instructions

  1. Publish your Evaluation data service functions for SQL use. For details see "Publishing Data Service Functions for SQL Use" in the Designing Data Services chapter of the Data Services Developer's Guide.
  2. http://download.oracle.com/docs/cd/E13167_01/aldsp/docs25/datasrvc/xds.html#wp1111244
  3. Build your application.
  4. Choose Start Arrow symbol Programs Arrow symbol BEA WebLogic Platform8.1Arrow symbol Other Development Tools Arrow symbol DBVisualizer. The DBVisualizer tool opens.
  5. Figure 12-1 DBVisualizer Interface


    DBVisualizer Interface

  6. Choose Database Arrow symbol Add Database Connection.
  7. Select the JDBC Driver tab from the Connection Data section.
  8. Enter the following parameters:
  1. Click Connect.
  2. Figure 12-2 New Database Connection Parameters


    New Database Connection Parameters

  3. Use DBVisualizer to explore your ALDSP application as if it were a database. Data service projects display as database schemas. Functions within a project display as a database view; functions with parameters display as database functions.
  4. Select a tab (Database Info, Data Types, Table Types, Tables, and References) to view that category of information for all data services within your application. For example, selecting the Tables tab displays each data service as a table.
  5. Figure 12-3 Tables


    Tables

  6. Double-click an element to view the values for a specific data service. For example, double-clicking the DataServices~CustomerDB element from the Table Schema column displays that data services values.
  7. Figure 12-4 Table Column Values


    Table Column Values

 


12.2 Integrating Crystal Reports and Data Services Platform

The Data Services Platform JDBC driver makes data services accessible from business intelligence and reporting tools, such as Crystal Reports, Business Objects, Cognos, and so on. In this exercise, you will learn how to use the Date Service Platform JDBC driver in conjunction with Crystal Reports. (For ODBC applications, you can use JDBC to ODBC Bridge Drivers provided by vendors such as OpenLink, available as of this writing at http://www.openlinksw.com.)

Objectives

In this exercise, you will:

Instructions

  1. Install Crystal Reports Viewer in the CustomerManagementWebApp by completing the following steps:
    1. Right-click CustomerManagementWebApp.
    2. Choose Install Arrow symbol Crystal Reports.
  2. Import a saved Crystal Reports file and JSP that displays the report by completing the following steps:
    1. Right-click CustomerManagementWebApp.
    2. Choose Import.
    3. Navigate to <beahome>\weblogic81\samples\LiquidData\EvalGuide and select the SpendByCustomers.rpt and showCrystal.jsp files:
    4. Click Import. You should see showCrystal.jsp and SpendByCustomers.rpt files within CustomerManagementWebApp.
    5. Right-click the CustomerPageFlow folder.
    6. Choose Import.
    7. Select index.jsp, located in <beahome>\weblogic81\samples\LiquidData\EvalGuide.
    8. Click Import and choose Yes when asked if you want to overwrite the existing index.jsp file.
  3. Open CustomerPageFlowController.jpf, located in CustomerManagementWebApp\CustomerPageFlow.
  4. Click the Start icon (or press Ctrl + F5) to run Workshop Test Browser.
  5. In Workshop Test Browser, click Customer Report to test the report. The first invocation may take time to display.
  6. Figure 12-5 Crystal Report


    Crystal Report

 


12.3 (Optional) Configuring JDBC Access through Crystal Reports

Crystal Reports 11 comes with a direct JDBC interface, which can be used to interact with the Data Services Platform JDBC driver.

Objectives

In this exercise, you will:

Instructions

  1. Install the Crystal Reports software, per the vendor's installation instructions.
  2. Add the JAVA_HOME as an environment variable. For example:
  3. JAVA_HOME=C:\j2sdk1.4.2_06

    where:

    C:\j2sdk1.4.2_06 

    identifies the Java SDK location on your computer.

  4. Make sure that the jvm.dll is in the path variable for your computer. For example:
  5. <$BEA_HOME>\jdk142_04\jre\bin\server
  6. Locate the Crystal Reports configuration file (CRConfig.xml). By default it is located on your Windows system in the following directory:
  7. Program Files/Common Files/Business Objects/3.0/java
  8. Make the following changes to the file:
  1. Create a new connection to a JDBC data source in Crystal Reports:
  1. Login to Crystal Reports. Once authenticated, Crystal Reports will display a view of the Evaluation application.

 


Lesson Summary

In this lesson, you learned how to:


  Back to Top       Previous  Next