Extremely Purexml in DB2 10 for Z/OS
Total Page:16
File Type:pdf, Size:1020Kb
Front cover Draft Document for Review January 9, 2011 1:25 pm SG24-7915-00 Extremely pureXML in DB2 10 for z/OS Develop Java and COBOL applications accessing SQL and XML data Administer your XML and SQL data Choose the best options for installation and use Paolo Bruni Neale Armstrong Ravi Kumar Kirsten Ann Larsen Tink Tysor Hao Zhang ibm.com/redbooks Draft Document for Review January 9, 2011 1:25 pm 7915edno.fm International Technical Support Organization Extremely pureXML in DB2 10 for z/OS January 2011 SG24-7915-00 7915edno.fm Draft Document for Review January 9, 2011 1:25 pm Note: Before using this information and the product it supports, read the information in “Notices” on page xvii. First Edition (January 2011) This edition applies to Version 10.1 of IBM DB2 for z/OS (program number 5605-DB2). This document created or updated on January 9, 2011. Note: This book is based on a pre-GA version of a program and may not apply when the program becomes generally available. We recommend that you consult the program documentation or follow-on versions of this IBM Redbooks publication for more current information. © Copyright International Business Machines Corporation 2011. All rights reserved. Note to U.S. Government Users Restricted Rights -- Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Draft Document for Review January 9, 2011 1:25 pm 7915TOC.fm Contents Figures . ix Tables . xi Examples . xiii Notices . xvii Trademarks . xviii Preface . xix The team who wrote this book . xix Now you can become a published author, too! . .xx Comments welcome. xxi Stay connected to IBM Redbooks . xxi Chapter 1. Introduction. 1 1.1 Importance of XML data . 2 1.1.1 Growth of XML . 2 1.1.2 The value of XML data . 3 1.2 XML introduction . 4 1.2.1 XML definitions . 4 1.2.2 Document validity and well-formedness . 5 1.2.3 XML Schema . 9 1.2.4 Extensible Stylesheet Language. 11 1.2.5 XPath . 13 1.2.6 XQuery . 15 1.2.7 XHTML . 15 1.2.8 XSL, XSLT, Xpath, and XHTML examples . 17 1.3 What is in this book . 19 Chapter 2. XML and DB2 for z/OS . 21 2.1 XML capabilities provided by DB2 . 22 2.1.1 Native XML data type . 23 2.1.2 SQL/XML language. 24 2.1.3 Hybrid data access . 31 2.1.4 XML update. 32 2.1.5 XML indexes . 34 2.1.6 XML schema repository and schema validation . 36 2.2 Supporting infrastructure. 38 2.2.1 XSR installation steps . 38 2.2.2 XSR installation validation . 39 2.2.3 XSR setup troubleshooting . 40 2.2.4 z/OS XML system services . 42 2.3 Choice of tools . 43 2.3.1 3270 based tools. 43 2.3.2 GUI based tools . 43 Chapter 3. Application scenario . 45 3.1 Requirement for XML event logging and auditing . 46 3.2 Application scenario . 46 © Copyright IBM Corp. 2011. All rights reserved. iii 7915TOC.fm Draft Document for Review January 9, 2011 1:25 pm 3.2.1 Using ISO 20022 with DB2 pureXML . 47 3.3 Application code samples . 48 3.3.1 DB2 SQL/XML programming pureXML. 49 3.3.2 Using Java with DB2 pureXML . 50 3.3.3 Using COBOL with DB2 pureXML . 50 Chapter 4. Creating and adding XML data . 51 4.1 Creation of tables with XML columns . 52 4.2 Storage structure for XML data . 52 4.3 Multi-versioning concurrency control for XML . 58 4.3.1 Example of improved concurrency with XML versions . 58 4.3.2 Example of improved storage usage with XML versions . 59 4.3.3 Storage structure for XML data with versions . 60 4.4 Catalog queries to gather information . 63 4.5 Display database command . 66 4.6 Ingesting XML data . 67 4.7 XML indexes . 70 Chapter 5. Validating XML data . 73 5.1 XML schema validation . 74 5.2 XML type modifier . 74 5.3 Automatic validation . 78 5.4 User-controlled validation . 82 5.5 Determining whether an XML document has been validated . 84 Chapter 6. DB2 SQL/XML programming . 87 6.1 Native SQL stored procedures and XML ..