The Ins and Outs of XML and DB2 for i5/OS

Book description

XML represents a fundamental change in computing. It allows applications to move away from proprietary file and data formats to a world of open data interchange. XML has become ubiquitous not only because of its range of applications, but also because of its ease of use.

Although XML solves many problems by providing a standard format for data interchange, some challenges remain. In the real world, applications need reliable services to store, retrieve, and manipulate data. These services have traditionally been offered by DB2 for i5/OS.

In this IBM Redbooks publication, we discuss the challenges of representing XML hierarchies in the relational database model. We provide an in-depth explanation of the three most popular approaches to bridge the hierarchy, the relational model dichotomy:

  • Programmatically process the XML documents and map their hierarchy into a relational database.

  • Use database middleware to handle the XML parsing and XML-to-relational database mapping.

  • Use Extensible Stylesheet Language (XSL) Transformation to transform inbound XML documents directly to SQL scripts.

We also share best practices and techniques aimed at streamlining the XML and DB2 for i5/OS integration.

Please note that the additional material referenced in the text is not available from IBM.

Table of contents

  1. Notices
    1. Trademarks
  2. Preface
    1. The team that wrote this redbook
    2. Become a published author
    3. Comments welcome
  3. Part 1: Introduction to DB2 for i5/OS and the scenario
  4. Chapter 1: Introduction to XML integration with DB2 for i5/OS
    1. 1.1: Overview of relevant XML technologies
      1. Hierarchical structure of XML documents
      2. Document type definition
      3. XML schema
      4. XPath and Location Path
      5. XSL and XSL Transformations
      6. Tools for working with XML
    2. 1.2: Advantages of DB2
    3. 1.3: XML to relational database mapping
      1. The challenge
      2. XML to RDB mapping concepts
    4. 1.4: Strategies for integrating XML with DB2 for i5/OS
      1. Programmatic approach
      2. Middleware (XML Extender) approach
  5. Chapter 2: Scenario overview
    1. 2.1: Model of the fictional scenario
    2. 2.2: Database model
    3. 2.3: XML document models
  6. Part 2: Programmatic approach
  7. Chapter 3: Using SQL to compose XML
    1. 3.1: Overview of stored procedures
    2. 3.2: Mapping the database to XML logically
    3. 3.3: Coding the SQL stored procedure
    4. 3.4: Compiling the SQL stored procedure
    5. 3.5: Running the SQL stored procedure
    6. 3.6: Deploying stored procedures
  8. Chapter 4: Using XSL Transformation and SQL
    1. 4.1: Decomposing XML using XSLT, Java, and SQL
    2. 4.2: Prerequisites
    3. 4.3: Decomposition planning and design
    4. 4.4: Decomposition coding
      1. Program flow
      2. Required modules
      3. Input documents
      4. Target table
      5. XSL transform document
      6. XSL document coding
      7. Transform processor
    5. 4.5: Decomposition module deployment
    6. 4.6: Decomposition execution
    7. 4.7: Some considerations for XSL decomposition
  9. Chapter 5: Using RPG for XML processing
    1. 5.1: Composing XML using RPG
      1. Prerequisites
      2. Composition planning and design
      3. Composition coding
      4. Deployment of RPG composition modules
      5. Composition execution
      6. Considerations for RPG composition
    2. 5.2: Decomposing XML using RPG
      1. Prerequisites
      2. Decomposition planning and design
      3. Decomposition coding
      4. Deployment of the RPG decomposition modules
      5. Decomposition execution
      6. Considerations for RPG decomposition
  10. Chapter 6: Using SAX and Java to decompose XML
    1. 6.1: Setting up the development environment
    2. 6.2: Defining the XML to RDB mapping
    3. 6.3: Implementing the mapping in Java (1/2)
    4. 6.3: Implementing the mapping in Java (2/2)
    5. 6.4: Deploying the solution to the System i machine
    6. 6.5: Running the deployed application
  11. Chapter 7: Advantages and disadvantages of the programmatic approach
    1. 7.1: Advantages
    2. 7.2: Disadvantages
  12. Part 3: Middleware approach
  13. Chapter 8: Overview of DB2 XML Extender
    1. 8.1: Product overview
    2. 8.2: Setup and common administration tasks
      1. Prerequisites
      2. Preparing your database for XML Extender
    3. 8.3: XML Extender storage and access methods
      1. XML Column method (1/3)
      2. XML Column method (2/3)
      3. XML Column method (3/3)
      4. XML Collection method
    4. 8.4: SQL mapping DAD composition example
      1. SQL mapping DAD methodology
      2. Building the SQL view
      3. Creating the SQL mapping DAD
      4. Executing the SQL mapping DAD composition
    5. 8.5: Handling very large documents
      1. Redefining user-defined types
      2. Redefining stored procedure parameters
      3. Application program and system changes
    6. 8.6: Additional considerations
      1. SQL naming convention
      2. Migration
      3. Commitment control
      4. Journal management
      5. Save and restore
      6. Troubleshooting and error messages
  14. Chapter 9: Performance-related information regarding XML Extender
    1. 9.1: Operating system levels and enhancements
      1. XML parser performance increase: V5R3 and V5R4 PTF
      2. XML Extender performance increase: V5R3 PTF
      3. XML Extender Quick Pool memory management: V5R4 PTF
      4. Technote
      5. PTF quick reference
    2. 9.2: XML Extender performance measurements
    3. 9.3: XSLT and XML Extender compared to XSLT and SQL
    4. 9.4: Performance summary
  15. Chapter 10: Shredding methodology
    1. 10.1: Setting up the development environment
    2. 10.2: Analyzing the XML document structure and determining the mapping
    3. 10.3: XSL Transform to insert unique keys for repeating elements
    4. 10.4: Modifying DTD and XSD to reflect the transformed document
    5. 10.5: Building the DDL script and adding RI constraints for the keys
    6. 10.6: Creating tables on the database server
    7. 10.7: Graphically mapping transformed DTD to relational tables (generating DAD) (1/2)
    8. 10.7: Graphically mapping transformed DTD to relational tables (generating DAD) (2/2)
    9. 10.8: Creating the wrapper stored procedure
    10. 10.9: Deploying the XSL, DAD, Java, and SQL to the integrated file system on the System i machine
    11. 10.10: Running the deployed application
  16. Chapter 11: Composing methodology
    1. 11.1: Setting up the development environment
    2. 11.2: Analyzing the database structure and outbound XML hierarchy
    3. 11.3: Creating the SQL view to project the data
    4. 11.4: Graphically mapping the relational database to XML (generating DAD)
    5. 11.5: Creating the wrapper stored procedure
    6. 11.6: Deploying DAD, SQL script to the integrated file system on the System i machine
    7. 11.7: Running the deployed application
  17. Chapter 12: Advantages and disadvantages of the middleware approach
    1. 12.1: Advantages
    2. 12.2: Disadvantages
  18. Part 4: Moving forward
  19. Chapter 13: A look into the future
    1. 13.1: Future XML technologies
      1. XQuery
      2. SQL/XML
      3. Hybrid and multistructured database management systems
      4. XLink
      5. XML Encryption
    2. 13.2: Future XML technologies on the System i platform
  20. Appendix A: Additional material
    1. Locating the Web material
    2. Using the Web material
      1. System requirements for downloading the Web material
      2. How to use the Web material
  21. Related publications
    1. IBM Redbooks
    2. Other publications
    3. Online resources
    4. How to get IBM Redbooks
    5. Help from IBM
  22. Index (1/2)
  23. Index (2/2)
  24. Back cover

Product information

  • Title: The Ins and Outs of XML and DB2 for i5/OS
  • Author(s): Jarek Miszczyk, Robert Andrews, David Andruchuk, Hernando Bedoya, Emily Chun
  • Release date: October 2006
  • Publisher(s): IBM Redbooks
  • ISBN: None