Generating DADX From SQL Queries Using WebSphere Studio

WebSphere Studio development tools, such as WebSphere Development Studio Client (WDSC), provide an XML from SQL wizard that supports the creation of a  DADX file from either SQL queries, DAD files, or both.

Document Access Definition Extension (DADX) is an XML technology for creating Web services that access relational databases. Combined with the DB2 Extenders, DADX supports mapping relational data in to complex XML documents and storing XML documents in the database.

A Document Access Definition (DAD) file is a user-specified file that provides control over the mapping of XML document elements to DB2 database columns for storage and retrieval. The XML to SQL wizard supports only Xcollection DAD. The types of mappings and operations supported by the XML from SQL wizard are as follows:

  1. SQL statement mapping (retrieve operation is supported)
  2. RDB_node mapping (store and retrieve operations are supported).

If you select SQL statement (SQL_stmt) mapping, you may need to customize the SQL_override information to specify the parameters you want to override from the SQL host variables. See the Web services Object Runtime Framework (WORF) documentation for more information.

Your SQL statement must exist in the workbench to complete the wizard. Follow these steps to generate a DADX file:

  1. In the XML perspective, select File > New > XML from SQL Query. The XML and SQL Query wizard opens.
  2. Select Create DADX from SQL query, then click Next.
  3. (Optional) Expand the folders and select the SQL statements that you would like to transform. Click Next.
  4. (Optional) Use this page to select one or more DAD files that you would like to include in your DADX file. Click the Import button to import a DAD file from your file system. Select a DAD file, then click >. Use the < and << push buttons to remove one or more DAD files from the Selected Files list. When you have added all of the DAD files required to the Selected Files list. Click Next.
  5. (Optional) You can modify or add text to the Operation or Description fields by selecting the row, then selecting the cell that you wish to modify. Type your changes, then press Enter.
  6. Type a file name for your DADX file. It must have the extension .dadx.
  7. (Optional) Enter a description of the file.
  8. Select the output folder, then click Finish.

The DADX file is generated and opens in the XML editor where you can edit it, as necessary.