Enabling DB2 Applications for the Next

sunfloweremryologistData Management

Oct 31, 2013 (3 years and 9 months ago)

88 views

-

Introduce IBM DB2 XML Extender

Enabling DB2 Applications for the Next
Generation Web and e
-
Commerce

Dr. Jane Xu

IBM Almaden Research Center

jxu@us.ibm.com

Enterprise
Information

Web Client

Enterprise Server

B2C, B2B
Data

Purchasing
Data

ERP Data

DB2

Extract,
Generate,

Transform,

Shred, Load

XML Extender

DB2 UDB

Enterprise
Information
Portal

Web Server

XML

XML

XML

XML

XML is the Key to Leverage DB2 Data for the

Next Generation Web

Enterprise
Data

DB2 XML Extender Overview

XML

Document

Your application

DB2 XML

Extender

DB2

tables

DAD

Document Access Definition

(DAD) specifies how to map

XML documents into tables

Feature 1: XML Column


A whole XML document is
stored in a table column


The DAD can identify
elements and attributes to be
indexed (in side tables) for
fast access. SQL data type
conversion is supported.


You can retrieve the whole
document or specific
elements/attributes identified
by XPath expressions.


Validation on input XML
documents is supported.


Appropriate for XML
documents that have
irregular structure and are
not frequently updated.


XML Extender can be used
together with Text Extender to
provide full
-
text search (stem
-
matching, etc.) for XML
documents.

Select db2xml.extractDouble(order,
'/Order/Part/Price) from order_tab
where invoice = 356

Example:

<?xml version="1.0"?>

<!
--
DOCTYPE Order SYSTEM "Order.dtd"
--
>


<Order key="1">


<Part key="1">


<Customer>37</Customer>


<Status>O</Status>


<Price>
131251.81
</Price>


<Date>1996
-
01
-
02</Date>


<Priority>5
-
LOW</Priority>


<Clerk>Clerk#000000951</Clerk>


<ShipPriority>0</ShipPriority>


<Comment>first part</Comment>


</Part>

</Order>

Invoice

Order

order_tab

356

Feature 2: XML Collection


XML document is generated
or decomposed from or into a
set of tables, linked by
primary and foreign keys.


Each table represents a
repeating group of elements
in the document.


Permits update of individual
elements and attributes
inside a document.


<?xml version="1.0"?>

<!
--
DOCTYPE Order SYSTEM "Order.dtd"
--
>


<Order key="1">


<Part key="1">


<Customer>37</Customer>


<Status>O</Status>


<Price>131251.81</Price>


<shipment>


<Date>1996
-
01
-
02</Date>


</shipment>


<shipment>


<Date>1999
-
11
-
26</Date>


</shipment>


</Part>

</Order>

order_tab

Key

Order

ship_tab

date

part_key

Key

Order_key

Customer

Status

Price

part_tab

Feature 2: XML Collection (Con't)


The DAD controls the mapping:


SQL Statement method: an SQL statement generates XML by joining the
underlying tables.


RDB
-
Node method: Each XML node is mapped individually to a table
and column.


Documents can be generated or shredded based on specified conditions.


Dynamic override of conditions is supported.


Appropriate for XML documents that have a regular repeating structure.


Also appropriate for presenting an XML view of existing DB2 tables.

Access Method:

Stored Procedure calls through JDBC, ODBC, Embedded SQL.


A method of producing XML documents from information stored in a IBM
Universal database.


Specifies a language for transforming DB2 database information into XML
documents, and a means of invoking transformations at a DB2 server.


The lightweight transform language is similar to XSLT (W3C XSL
Transformations), providing specific constructs for retrieving information
from DB2 databases.


The language is not intended to be a full transformation language, or a rival
to XSLT, but simply a way for IBM customers to generate nontrivial XML
documents from their data servers.

XML
Transform

tables

DB2

XML

Document

Feature 3: XML Transform


Provides storage, retrieval, and update of XML documents in a
single column.


Composes existing DB2 data into XML documents.


Stores XML documents as a collection of DB2 data, in multiple
columns and tables.


Manages your DTD repository.


Extracts XML elements and attributes into traditional SQL data
types, leveraging DB2 sophisticated indexing and SQL query.


Provides a wizard for easy administration.


Supports international code pages.


Support platforms of AIX, Linux, NUMA
-
Q, Solaris, UNIX,
Windows 2000 and Windows NT, OS/390(V6), AS/400(V5R1).

Summary

URL:

http://www
-
4.ibm.com/software/data/db2/extenders