Skip to main content


developerWorks  >  Information Management | XML  >

DB2 9 Application Developer Certification Exam 733 prep, Part 3: XML data manipulation

Store and retrieve XML through your application

developerWorks

Level: Introductory

Donald E. Payne (payned@us.ibm.com), Advisory IT Specialist, IBM 

16 Mar 2007

Register now or sign in using your IBM ID and password.

Learn how IBM® DB2® parses XML, handles whitespace, and serializes XML, and see how document encoding and client data type affect parsing and serialization. Learn, also, how DB2 validates XML against an XML schema as well as how to use SQL/XML functions to "shred" XML to relational data, assemble relational into XML, and publish XML as relational data types to hold XML data.

Objectives

  • Learn how DB2 and a DB2 client application manipulate XML data

  • Learn how DB2 handles boundary whitespace on input

  • See how DB2 determines the encoding of an XML document on input and output

  • See how DB2 can validate XML on input

  • Find out how to execute an XQuery or XPath and identify its results

  • Learn how to decompose, or shred, XML input to relational rows

  • Find out how to publish relational data as XML

  • See how to publish XML data as relational

Prerequisites

Before taking Exam 733, you must pass the DB2 9 Family Fundamentals exam (Exam 730). You can use the DB2 9 Family Fundamentals tutorial series to help prepare for that exam.

This tutorial is written for DB2 developers who are familiar with the following concepts:

  • XML, including:
    • Elements
    • Attributes
    • Documents
    • Well-formed documents
    • XML declarations
    • Namespaces
  • XPath, including the XML Data Model (XDM):
    • Nodes
    • Atomic values
    • Items
    • Sequences
    • Axis: Parent, child, descendant, and so on
    • Steps
    • Wild cards
    • Predicates
  • XQuery:
    • The db2-fn functions xmlcolumn(), sqlquery()
    • FLWOR expression: for, let, where, order by, return
    • prolog
  • XML Schema, validation, and namespaces
  • The concepts of character encoding and Unicode

For the code examples, you should be familiar with:

  • The programming language
  • Any interfaces or libraries used, such as CLI and JDBC
  • The data types that the language supports and how they map to DB2 SQL types

System requirements

To complete this tutorial, you need the following:

  • A computer running Linux, UNIX, or Windows, with DB2 9 FixPack 1 installed
  • An editor, such as Rational Application Developer, Windows Notepad, or vi (see the Resources section of this tutorial for more information)
  • A compiler to run code examples. The DB2 Information Center page on supported programming languages and compilers for database application development links to pages listing supported compilers in all supported languages:
    • Supported C compilers: See the Resources section, subsection "Get products and technologies."
    • For the Java language, DB2 on Windows comes with a Java 2 SDK, Version 5, including the compiler javac and runtime environment (JRE), under SQLLIB\java\jdk. (On most platforms, DB2 9 supports Java 2 SDK, Versions 1.4.2 through 5. See DB2 Information Online, "Supported Java application development software," for details.) The JDK includes the JRE under the SQLLIB\java\jdk\jre directory. Your PATH environment needs to include the bin directories under jdk; CLASSPATH needs to include some JAR and ZIP files under SQLLIB\java.
  • A browser is handy for viewing an XML file, checking that it is well-formed, and finding mistakes


Duration

Less than two hours


Formats

html, pdf


Tutorial overview

This is the third in a series of nine tutorials that is designed to help you prepare for the DB2 9 Application Developer Certification exam (Exam 733). The material in this tutorial covers the objectives in Section 3 of the exam, entitled "XML data manipulation."

Share this....

digg Digg this story del.icio.us del.icio.us Slashdot Slashdot it!


Back to top


Document options

Document options requiring JavaScript are not displayed

Discuss


More in this series:
DB2 9 Application Developer Certification Exam 733 prep