XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Go to previous topicPrev TopicGo to next topicNext Topic
SSDN AdminSubject: New XQJ Tutorial and Example Files
Author: SSDN Admin
Date: 10 May 2005 03:48 PM
The XQuery language is designed specifically for XML programming and data integration, and programmers are more productive using XQuery for these tasks. However, many enterprise applications are built on the Java platform, and often require functionality not found in XQuery; for instance, many XML programs need to use the Web Services functionality of J2EE. On the Java platform, XML is accessed and manipulated as a DOM tree, a SAX stream, or as a StAX stream.

The XQuery API for Java, currently under development as JSR 225, lets programmers have the best of both worlds, using XQuery for XML programming and data integration, with full access to the J2SE and J2EE platforms. XQJ allows a Java program to connect to XML data sources, prepare and issue XQueries, and process the results as XML. This functionality is similar to that of JDBC® Java API for SQL, but the query language for XQJ is XQuery.

This article shows how XQJ is used to issue XQueries and obtain results. Next, it shows how XQJ can be used to query DOM trees, perform joins between XML and relational sources, obtain results using StAX, and issue prepared XQueries (similar to JDBC's prepared statements). Finally, we show four complete, working XQJ programs, including one that uses StAX to handle output. These programs are based on the Early Draft Review of JSR-225, released in May 2004. Code examples were tested with a pre-release version of DataDirect XQuery™, which implements XQuery and XQJ.

Read the article online at: http://www.datadirect.com/developer/xquery/topics/xqj_tutorial/

Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.