Before you start
The IBM Certified Application Developer certification confirms to others that you are an intermediate- or advanced-level IBM DB2 for Linux®, UNIX®, and Windows® application developer and shows that you have strong skills in all common programming tasks as well as embedded SQL programming, ODBC/CLI programming, .NET programming, or Java™ programming.
This series of nine free tutorials is designed to help you prepare for the DB2 9 Application Development for Linux, UNIX, and Windows certification exam (Exam 733). Each tutorial includes a link to a free DB2 9 for Linux, UNIX, and Windows trial download. These tutorials provide a solid base for each section of the exam. However, you should not rely on these tutorials as your only preparation for the exam.
This tutorial teaches you how DB2 and a DB2 client application manipulate XML data. You'll learn:
- How DB2 handles whitespace on input
- How DB2 determines the encoding of an XML document on input and output
- How DB2 can validate XML on input
- How to execute an XQuery or XPath and identify its results
- How to decompose, or shred, XML input to relational rows
- How to publish relational data as XML
- How to publish XML data as relational
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, titled "XML data manipulation."
After completing this tutorial, you should be able to write applications that store and retrieve XML.
This tutorial is written for DB2 developers who are familiar with the following concepts:
- XML, including:
- Well-formed documents
- XML declarations
- XPath, including the XML Data Model (XDM):
- Atomic values
- Axis: Parent, child, descendant, and so on
- Wild cards
- The db2-fn functions
- FLWOR expression: for, let, where, order by, return
- The db2-fn functions
- 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
See the Resources section for links to this information.
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."
the Java language, DB2 on Windows comes with a Java 2 SDK,
Version 5, including the compiler
javacand 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 Web browser is handy for viewing an XML file, checking that it is well-formed, and finding mistakes
If you run the SQL examples from this tutorial in the DB2 Command Line
db2, see the section titled
"DB2 Command Line Processor (CLP)
behavior and options."