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]

Kick-start your J2EE applications using DB2 9 with pureXML and WebSphere Community Edition

If you can access relational data, you can access XML

Gerald Leung (gktleung@ca.ibm.com), Database Technology Advocate, IBM
Gerald Leung is a computer science co-op student at the University of Toronto. He expects to complete his B. Sc. in August 2007. Gerald is working at IBM Toronto lab's Developer Initiatives department to take advantage of his interest in experimenting, configuring, and testing client/server technologies.
Lin Sun (linsun@us.ibm.com), Advisory Software Engineer, IBM
Lin Sun is an advisory software engineer for IBM in Research Triangle Park, North Carolina, in the Software Group WebSphere Application Server Community Edition Development Team. She received a master's degree in information science from the University of North Carolina at Chapel Hill.

Summary:  New features in the latest version of the IBM® DB2® database make it possible to access and manipulate XML data just as you would data in a standard relational database. In this tutorial, you'll learn to set up a DB2 9 database and WebSphere® Application Server Community Edition on a Windows™ or Linux® environment, then write and deploy a Java™ applications that takes advantage of DB2 9's XML capabilities.

Date:  19 Sep 2006
Level:  Intermediate PDF:  A4 and Letter (674 KB | 22 pages)Get Adobe® Reader®

Activity:  12550 views
Comments:  

Before you start

About this tutorial

This tutorial takes you through the process of setting up IBM WebSphere Application Server Community Edition software (hereafter referred to as Community Edition) and an IBM DB2 9 database on a Linux or Microsoft® Windows environment. You'll also see what's involved in writing and deploying Java 2 Platform, Enterprise Edition (J2EE) applications that run on Community Edition. You will learn to take advantage of the DB2 9 pureXML technology to store XML in its native format, and to use Community Edition to serve J2EE applications.


Why use DB2 9?

DB2 9 is the industry's first hybrid data server for managing data in both relational and pure XML formats. DB2 has long provided high-performance data storage and access for relational data based on SQL standards, along with data storage optimizations such as data partitioning and advanced indexing and query optimization techniques. Now, DB2 has introduced an optimized data storage engine for XML data alongside its existing relational engine. Application developers can now store XML data directly inside of a DB2 server and reap the benefits of transactions, advanced data resiliency, secure access, and, of course, the ability to search large amounts of XML data using XQuery.

XML data is often used for interapplication data exchange and document management purposes. The flexible and self-describing nature of XML data makes it ideal for many application scenarios.

The ability to query XML data has traditionally been quite limited. Recently, a new standards-based XML query language has been published. This query language is known as XQuery; version 1.0, was released in November 2005. It is an extension of existing XPath 2.0 standard. See Resources for more about XQuery and XPath.


Why use Community Edition?

IBM WebSphere Application Server Community Edition is a J2EE application server built on top of Apache Geronimo, an open source application server created by the Apache Software Foundation. If you need a lightweight application server as a test platform to run your J2EE applications and would prefer to have a build that is relatively stable, well-tested, and available with world-class support, then Community Edition is your best choice, both technically and economically. You can be confident that you are using an application server that is stable enough to run your applications and prototypes; plus, Community Edition is free to download and use. You can install it and get it running quickly and then get on with the business of evaluating or demonstrating your prototypes. You can continue to use the product at no cost, purchase optional IBM support as needed, or even migrate to other WebSphere Application Server products if you desire.


Objectives

This tutorial will help familiarize you with Community Edition administration, and with writing Java code that uses and stores XML in DB2 9. You will perform the following tasks:

  1. Install required software.
  2. Set up a DB2 9 database and configure Community Edition to use DB2 9.
  3. Deploy a data source to Community Edition for connection pooling.
  4. Deploy a sample J2EE application to Community Edition.
  5. Analyze the Java code for the sample application and understand how it works.

Prerequisites

This tutorial is written for application developers who have at least introductory experience with DB2 9, some experience with SQL and the Java platform, and some knowledge of XML.


System requirements

To run the examples in this tutorial, you need:

Refer to the DB2 9 system requirements page and the Community Edition system requirements page to make sure that your hardware meets their respective requirements.

See the developerWorks tutorial "DB2 XML evaluation guide" (see Resources) for steps on installing DB2 9. DB2 9 will automatically start after installation. Also, refer to the "Download and install Community Edition" section of the developerWorks article "Get started with WebSphere Application Server Community Edition" (see Resources) to see how to download the install bundle appropriate for your platform and install Community Edition.

Apache Ant is an open source, Java-based build tool. You can find information on installing Apache Ant on the project's home page.

You also need to download the sample J2EE application that is used to demonstrate the concepts in this tutorial. The code and required data for this application are in the file j2ee_development_db2.zip. Extract the contents of j2ee_development_db2.zip to a directory such as C:\j2ee_development_db2 or /home/userid/j2ee_development_db2. This directory is referred to simply as j2ee_development_db2 throughout the tutorial. This tutorial assumes you used the default directories when installing DB2 9 and Community Edition.

1 of 9 | Next

Comments



static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Information Management, Java technology, XML, WebSphere
ArticleID=160517
TutorialTitle=Kick-start your J2EE applications using DB2 9 with pureXML and WebSphere Community Edition
publish-date=09192006
author1-email=gktleung@ca.ibm.com
author1-email-cc=gerald.leung@utoronto.ca
author2-email=linsun@us.ibm.com
author2-email-cc=