Generating a DAD File for IBM DB2

IBM DB2 v8.1 (or higher) is a database server with an add-in for XML storage and retrieval called IBM DB2 Extender. XML data (elements, attributes) are mapped to relational data (tables, columns) through Document Access Definition files (.DAD).

There are three types of DAD files:

Storage Type

Description

Xcolumn

Column mapping - the Root element is mapped to a table, and its attributes or child elements are mapped to columns identified by an XPath

Xcollection

SQL mapping - the DAD file starts with a SQL statement for the table mapped to the Root element, and each child element or attribute is mapped to a column or a table name

Xcollection

RDB mapping - a Relational Database node, with a table and a column name, is associated with each attribute or child element of the Root element

An XML model targeted with DTD allows you to generate DAD files for IBM DB2.

  1. Map an XSM to a PDM. You can do this manually or by generating an XSM from a PDM (or a PDM from an XSM) but we recommend that you use the XML Builder Wizard (see Mapping database objects to an XML schema via the XML Builder Wizard)
  2. [if you do not use the wizard] Attach the SQL/XML extended model definition (see Attaching the SQL/XML extended model definition).
  3. Further specify the mappings with extended attributes (see Reinforcing DB2 mappings with extended attributes).
  4. Generate the annotated schema (see Generating a DB2 DAD file).