Enabling DB 2 Applications for the Next Generation

Enabling DB 2 Applications for the Next Generation Web and e-Commerce - Introduce IBM DB 2 XML Extender Dr. Jane Xu IBM Almaden Research Center jxu@us. ibm. com

XML is the Key to Leverage DB 2 Data for the Next Generation Web Server Web Client Enterprise Server DB 2 UDB XML Extender Extract, Generate, Transform, Shred, Load ERP Data XML Enterprise Information Portal B 2 C, B 2 B Data XML DB 2 Enterprise Data Purchasing Data Enterprise Information XML

DB 2 XML Extender Overview Your application XML Document DB 2 XML Extender DB 2 tables DAD Document Access Definition (DAD) specifies how to map XML documents into tables

Feature 1: XML Column n n n 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. order_tab Invoice Order 356 <? 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> <Ship. Priority>0</Ship. Priority> <Comment>first part</Comment> </Part> </Order> Example: Select db 2 xml. extract. Double(order, '/Order/Part/Price) from order_tab where invoice = 356

Feature 2: XML Collection n 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. order_tab Key Order <? 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> <Date>1999 -11 -26</Date> </shipment> </Part> </Order> ship_tab part_tab Key Customer Price Status Order_key date part_key

Feature 2: XML Collection (Con't) n n n 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 DB 2 tables. Access Method: Stored Procedure calls through JDBC, ODBC, Embedded SQL.

Feature 3: XML Transform n n A method of producing XML documents from information stored in a IBM Universal database. Specifies a language for transforming DB 2 database information into XML documents, and a means of invoking transformations at a DB 2 server. The lightweight transform language is similar to XSLT (W 3 C XSL Transformations), providing specific constructs for retrieving information from DB 2 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 Document XML Transform DB 2 tables

Summary Provides storage, retrieval, and update of XML documents in a single column. n Composes existing DB 2 data into XML documents. n Stores XML documents as a collection of DB 2 data, in multiple columns and tables. n Manages your DTD repository. n Extracts XML elements and attributes into traditional SQL data types, leveraging DB 2 sophisticated indexing and SQL query. n Provides a wizard for easy administration. n Supports international code pages. n Support platforms of AIX, Linux, NUMA-Q, Solaris, UNIX, Windows 2000 and Windows NT, OS/390(V 6), AS/400(V 5 R 1). n URL: http: //www 4. ibm. com/software/data/db 2/extenders
- Slides: 8