Describing and Accessing Data: Overview

 

Introduces data source descriptions and explains how to use them.

Developer Workbench provides a set of graphical tools that you can use to describe and access many types of data sources, including:

These graphical tools are designed to:

 

Parent topic:

IBM DB2 Web Query for System i Overview

 

A Note About Data Source Terminology

Different types of data sources make use of similar concepts, but refer to them differently. For example, the smallest meaningful element of data is called a field by many hierarchical database management systems and indexed data access methods, but called a column by relational database management systems.

There are other cases in which a common concept is identified by a number of different terms. For simplicity, we have standardized on a single set of terms. For example, we usually refer to the smallest meaningful element of data as a field, regardless of the type of data source. However, when required for clarity, we use the term specific to a given data source. Each time we introduce a new standard term, we define it and compare it to equivalent terms used with different types of data sources.

 

How Applications Interpret Data

When your application accesses a data source, it needs to know how to interpret the data that it finds. To accomplish this it reads a synonym, which is a term for the generated metadata associated with the particular data source.

Your application needs to know about:

The synonym provides an alias for the data source that tells the server how tables are described and where to find them.

The primary component of a synonym is a Master File. The Master File describes the structure of a data source and its fields. For example, it includes information such as field names and data types.

For some types of data sources, an Access File supplements the Master File. An Access File includes additional information that completes the description of the data source. For example, it includes the full data source name and location. The nature of the information in the Access File is specific to each data source. You need one Master File—and, for some types of data sources, one Access File—to describe a data source.

 

How to Obtain a Synonym

You can generate synonyms using the Metadata menu option in Web Query, which enables you to explore DBMS catalogs and select the objects for which you wish to create synonyms. The tool prompts for all the information it needs to create a synonym for a particular data source and stores the generated synonym on the server.

There are some prerequisites: be authorized to use the data against which you plan to report and have configured an adapter to access that type of data. In fact, when you begin to create a synonym, Developer Workbench opens the adapter configuration window. The option to create the synonym becomes available only after the adapter is successfully configured.

Adapters are available for many data sources. Every adapter is specifically designed for the data source that it accesses, and, as a result, is able to translate between SQL or DB2 Web Query and the data management language (DML) of the data source. Adapters provide solutions to product variations, including product differences in syntax, functionality, schema, data types, catalogs, data representations, message processing, and answer set retrieval. It is the adapter that manages the synonym creation process. For related information, see How an Adapter Works.

 

How an Adapter Works

The adapter manages the communication between the data interface and the data source, passing data management requests to the data source and returning either answer sets or messages to the requestor. To perform these functions, the adapter:

 

What You Can Do With a Synonym

Once you have generated a synonym, you can report against it using all of Web Query’s reporting tools. In many instances, the configured adapter and the generated synonym are all access your data and create reports and graphs.

However, you may wish to enhance the synonym in order to implement particular capabilities that are supported in the DB2 Web Query data description language. To do this, you can use a second data description tool, the Synonym Editor.

When you use the Synonym Editor, there is no need to know the data description language since the graphical tool displays all viewable and editable attributes of the synonym components. If you make changes to the generated synonym, the Synonym Editor validates your entries and displays messages if they violate the underlying syntax of the data description language.

 

Ways to Enhance a Synonym

Here are just a few of the attributes you might want to add to the synonym to enhance your data access and reporting capabilities. You can:

The Synonym Editor is fully described in Using the Synonym Editor.

 

How an Application Uses a Synonym

Synonyms are stored apart from the associated data source. Your application uses a synonym to interpret the data source in the following way:

  1. It identifies, locates, and reads the Master File for the data source named in a request.

  2. It locates and reads the Access File for the data source named in the request, if that type of data source requires an Access File.

  3. It locates and reads the data source(s).

The data source contents are interpreted based on the information in the synonym.