Home | Business News | Browse by Publication | X | XML Journal

The perfect database round-trip using JAXB & JDO: avoiding complex Java programming to persist and access data.

Publication: XML Journal
Publication Date: 01-SEP-03
Format: Online - approximately 2344 words
Delivery: Immediate Online Access

Article Excerpt
Java Data Objects (JDO) enables Java developers to perform database transactions from within Java objects without writing database (SQL)- or JDBC-specific code. Java Architecture for XML Binding (JAXB) and JDO provide great APIs for performing complex XML- and database-oriented tasks. But what about using the two in tandem? This article is about combining these technologies to solve the complex tasks of data access and data persistence.

Java classes can be generated by compiling XML Schemas using JAXB technology. As long as a schema is a well-formed XML document with a definition of simple or complex types, JAXB can generate lava interfaces and classes for each data type defined in the schema. JAXB also provides methods to unmarshall an XML instance document into a Java content object tree. The reverse process is also supported by JAXB. It allows you to marshall the Java content tree back to the XML instance document. This article focuses on the unmarshalling techniques of JAXB.

The JDO API is a standard interface-based Java model abstraction of persistence. Java developers use JDO to store Java objects that hold data (they resemble JavaBeans) into the persistent store (database). When you use JDO, you just need to know Java--no other programming language is required.

This article shows you how to build a simple application that reads customer data from an XML file. We'll deploy JAXB to create a customer Java object model and will also use IDO to store these objects in the database. The example included here uses only the reference implementation released by JavaSoft and its partners.

The JAXB specifications and documentation can be downloaded from http://java.sun.com/xml/jaxb, and JDO specifications and documentation can be downloaded from http://java.sun.com/products/jdo. (You will need the latest version of JDO 1.0.1 to run the example http://accessl. sun.com/jdo/private/index.html). Also, the example uses JAXB bundled with the Java Web Services Developer Pack (http://java.sun.com/webservices/downloads/webservicespack.html). Complete installation steps are explained in the readme.txt.

Why JAXB and JDO?

Although a lot of work must done to explore the use of these two technologies working in tandem, because the JAXB generates Java objects that...

Read the FULL article now - Try Goliath Business News - FREE!   
You can view this article PLUS...

  • Over 5 million business articles
  • Hundreds of the most trusted magazines, newswires, and journals (see list)
  • Premium business information that is timely and relevant
  • Unlimited Access

Now for a Limited Time, try Goliath Business News - Free for 3 Days!
Tell Me More   Terms and Conditions

Get Goliath Business News for 1 year - Just $99 (Save 65%)
Tell Me More   Terms and Conditions

Already a subscriber? Log in to view full article



More articles from XML Journal
Creating reusable visual components: a consistent look and feel throug..., September 01, 2003
Web Services Edge: International Web Services Conference & Expo: Sept...., September 01, 2003
XML Certification quizzer: getting your next XML job.(XML Labs), September 01, 2003
Using XML Schemas effectively in WSDL design: achieve a higher degree ..., September 01, 2003

Looking for additional articles?
Search our database of over 3 million articles.

Looking for more in-depth information on this industry?
Search our complete database of Industry & Market reports by text, subject, publication name or publication date.

About Goliath
Whether you're looking for sales prospects, competitive information, company analysis or best practices in managing your organization, Goliath can help you meet your business needs.

Our extensive business information databases empower business professionals with both the breadth and depth of credible, authoritative information they need to support their business goals. Whether it be strategic planning, sales prospecting, company research or defining management best practices - Goliath is your leading source for accurate information.