Learn XQuery |
Home:Learn XQuery:White Papers:ACORD:Why DataDirect XQuery™ Beats SQL and XML DOM Comparing Solutions Using DataDirect XQuery™ versus SQL and XML DOMThe XQuery and Java examples described in XQuery Operation Examples for an ACORD Insurance Application and Using DataDirect XQuery™ to Bind External Variables to Dynamic Values are all very interesting, and show how powerful XQuery and the DataDirect XQuery™ implementations are in manipulating ACORD XML messages, EDI messages, and relational databases. But why do you need them? Can you implement the same tasks writing traditional Java code that executes SQL queries over JDBC and that fetches/create XML documents through XML DOM interfaces? Of course you can, but the cost of doing that compared to the combination of XQuery and Java is huge, and the best way to describe that is to show a couple of examples that you can compare with the XQuery solutions described in the other sections. The first example is about processing an ACORD message requesting information about a specific policy product (tc=201) (the corresponding XQuery is described in Updating a Relational Database, and the necessary Java layer to execute the XQuery is described in Using DataDirect XQuery™ to Bind External Variables to Dynamic Values. If we want to solve the same problem using Java+SQL+XML DOM (already it seems more complicated), then you need a Java application similar to the one described in this file: acord201JDBC.java. Just comparing the visual size of the two solutions makes the XQuery-based approach particularly appealing. Not only does the XQuery solution provide coding economy, but it does not suffer from any of the drawbacks of the Java+SQL+XML DOM approach. In the Java+SQL+XML DOM approach:
The second example is based on an ACORD party inquiry, which requires joins across multiple tables, as described in Performing a Search and Inquiry Using Multiple Joins. This makes the Java+SQL+XML DOM solution much more complicated, as you can see in the Java code acord204JDBC.java. Now three SQL queries are needed, and the creation of the XML result gets significantly more complicated. With its superior economy, ease of development (and ease of maintenance), simple access to and manipulation of relational and legacy data, and integration with XQJ, DataDirect XQuery™ provides an elegant solution for application developers and integration architects working with ACORD and other standards. Try it yourself! What's Next?Go to Installing and Running DataDirect XQuery™ ACORD Examples to learn how to install and run the examples described in these pages on your local machine. |
DataDirect XQuery FAQThis informative DataDirect XQuery® FAQ answers frequently-asked questions about DataDirect XQuery® , including questions about performance, scalability, use-cases, resources, and more. If you're more of a hands-on learner, then download a free copy and start exploring DataDirect XQuery® today! New Case StudyGevity produces sales proposals in real time using DataDirect XQuery® . See how Gevity uses DataDirect XQuery® to combine Web service data from SalesForce.com with relational data in Oracle in a pricing engine for HR management. |





