XML storage in IMS databases
Because XML and IMS™ databases are both hierarchical, IMS is an effective database management system for managing XML documents.
With IMS, you can easily receive and store incoming XML documents and compose XML documents from existing information that is stored in IMS databases.
For example, you can:
- Compose XML documents from all types of existing IMS databases to support, for example, business-to-business on demand transactions and intra-organizational sharing of data.
- Receive incoming XML documents and store them in existing or new IMS databases.
IMS can stores XML documents in an intact storage mode, in a decomposed storage mode, or in a combination of the two.
In the decomposed storage mode, IMS parses the XML documents and stores the element data and attributes in segment fields as normal IMS data. The decomposed storage mode is appropriate for data-centric documents.
In the intact storage, the incoming document, including its XML tags, is stored directly in the database and IMS is unaware of its structure. Intact storage is appropriate for document-centric XML documents.
To store XML in an IMS database or to retrieve XML from IMS, you must first generate two artifacts: an XML schema and the Java™ metadata class for IMS. You can generate the Java metadata class by using the IMS Enterprise Suite Explorer for Development. You can generate the XML schema either by hand or with the IMS Enterprise Suite DLIModel utility plug-in. The metadata and schema are used during the storage and retrieval of XML.
Your applications use the IMS Universal type-4 JDBC driver to store XML in IMS databases, create XML from IMS data, and retrieve XML documents from IMS databases. Alternatively, if you are using the IMS classic JDBC drivers, you can use the user-defined IMS functions storeXML and retrieveXML.
The following figure shows the process for storing and retrieving XML in IMS.
