Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Querying XML from Java applications

Search XML data and process the results

Date:  07 Oct 2011 (Published 28 Jul 2011) |Level: Introductory |

1. Learn XQuery principles and syntax

XQuery, an official World Wide Web Consortium (W3C) recommendation, is a functional language for extracting information from XML documents. A superset of XML Path Language (XPath), XQuery lets you select precise sets of data from an XML document or documents and output an XML structure. Learn what XQuery is all about and take it for a test drive (sans Java) via pureXML, a native XML engine in IBM DB2.

2. Invoke XQuery from Java code

With XQuery syntax under your belt, you can exploit the XQuery API for Java (XQJ) to invoke XQuery within Java applications. XQJ — a Java platform standard implemented in various data-integration products — defines a set of interfaces and classes that enable a Java application to submit XQuery queries to an XML data source and process the results.

3. Leverage XQJ for more-advanced applications

Take XQuery processing via XQJ to a higher level in your Java applications. XQuery functions enable you to define common expressions once and reuse them frequently, resulting in code that's tighter, more robust, and easier to maintain. And explore the advantages of using XQuery as the view technology in web applications that follow the Model-View-Controller pattern.

4. Graduate to pureQuery

IBM pureQuery is a high-performance platform for developing and managing Java applications that access data from a database. pureQuery's data-access API can be easily extended to support both querying of XML documents stored in an XML column in a DB2 pureXML database and mapping of XML result sets into collections of Java objects. Learn how to develop pureQuery applications that work with pureXML data.




Rate this content




Give us feedback

Submission failed. Please try again.

Please complete one of the following questions before submitting.

1. Are you finished with this knowledge path?

       

2. How much did you learn?

           

3. Tell us more

  • What did you like/dislike?
  • What can we do better?

2500 characters left

Disabled Submit button

developerWorks: Sign in


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

Choose your display name

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

(Must be between 3 – 31 characters.)


By clicking Submit, you agree to the developerWorks terms of use.

 


Save your progress Green checked checkmark

When you sign in, we will save this item to your developerWorks community home page and track your progress so you know what you've completed and where to resume when you return.

For a list of your saved items, see your My Home > My saved items page.

Thank you for your feedback. We appreciate your sharing your opinion with us.

Do you want to save your progress?

, Sign in to save your progress

Save your progress

Sorry. Our server is not available, and we cannot display your saved progress at this time.

Your progress will be displayed when the server is available again. Any previous progress is retained, and additional progress is being tracked.

If your most recent progress is not displayed within 24 hours, you can click the checkmark to indicate completion.

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Java technology
ArticleID=756148
publish-date=10072011