Free Newsletters:
DatabaseJournal  
DBANews
Database Journal
Search Database Journal:
 
HOME News MS SQL Oracle DB2 Access MySQL PostgreSQL PHP SQL Etc Scripts Links Discussion
internet.com

» HOME
» NEWS
» FEATURES
» SERIES
MS SQL
Oracle
MS Access
MySQL
DB2
» RESOURCES
Products
Scripts
Links
» DISCUSSION
» TECH JOBS

Marketplace Partners
Be a Marketplace Partner




internet.commerce
Be a Commerce Partner
Logo Design
Online Education
Memory Upgrades
Computer Deals
Calling Cards
GPS Devices
Hurricane Shutters
Baby Photo Contest
Promotional Pens
Remote Online Backup
Promotional Golf
Build a Server Rack
Online Shopping
Online Education




MySpace Joins eBay, Yahoo in Open Profile Push

News Corp. Unit Under Fire for Ties to Hacker

Are Non-PC Devices Hurting 'Net Innovation?

internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


Linked Data Planet Conference & Expo

CA ERwin® Data Modeler Proven database design and modeling. Efficiently analyze, design and deploy effective database solutions. Whitepaper: Manage SQL Server Deployments
Try it free: CA ERwin® Data Modeler


Solaris 8 Migration Assistant
Rapidly move your Solaris 8 application environments to new systems running Solaris 10 with the Solaris 8 Migration Assistant. Reduce migration risk while taking advantage of increased performance, reliability and security of the latest SPARC hardware platforms and Solaris 10 OS. »

 
Sun Eco Innovation: Good for Business, Good for the Environment
A complete solution to help you optimize and refresh your datacenter while properly recycling equipment and eliminating eWaste, including money-saving promotions to lower hardware acquisition costs. »

 
Sun Eco Innovation: Power Calculators
Power consumption has increasingly become a priority in customer's minds when purchasing new systems or storage. Sun's Power Calculators provide data on power consumption of Sun products allowing IT managers to better plan the power requirements in the datacenter to achieve better energy and cost savings. »

 
Optimize the Web Tier: Consolidate to Get More Performance in Less Space and Lower Power Consumption
Expansion in the Web tier is generally accomplished by adding more servers whenever extra capacity is needed. As the pool of servers grows larger, however, the complexity of the environment can grow exponentially. »
Related Articles
Creating an XML Schema Definition (XSD) document with the DB2 tools for Visual Studio 2005

Production Manager (hands on)
Aquent
US-MA-Cambridge

Justtechjobs.com Post A Job | Post A Resume
DB2
November 9, 2006
Registering XML Schema in DB2 9 Using Visual Studio 2005
By Paul Zikopoulos

In a previous series of articles, I showed you the integration features between the IBM DB2 Universal Database for Linux, UNIX, and Windows Version 8.x (DB2 UDB) product and the Microsoft Visual Studio.NET 2003 integrated development environment (IDE).

In early June 2006, IBM announced the next release of the DB2 UDB product, DB2 9. Part of this announcement includes the support for Microsoft Visual Studio 2005 and its accompanying ADO.NET 2.0 driver.

As you may recall, Microsoft announced the Visual Studio 2005 product, along with SQL Server 2005, in late 2005. Around the same time, IBM delivered a beta of the now officially announced DB2 integration into Microsoft Visual Studio 2005 and ADO.NET 2.0.

The beta-version of this code became generally available when DB2 9 made its debut in August 2006, and you can download it at: https://www14.software.ibm.com/webapp/iwm/web/preLogin.do?source=dbaddvs&S_TACT=105AGX11&S_CMP=TILE=.

For this article, I recommend that you download the free DB2 Express-C product, which includes the pureXML feature, so you can follow the steps outlined in this article. You can download your own free no-database-size-limit copy of DB2 9 (which also includes 64-bit support) at: http://www.ibm.com/db2/express.

As I’ve been writing about the DB2 integration into Visual Studio 2005, I’ve discussed the following topics in other articles:

In this article, I want to show you how you can leverage the Visual Studio 2005 XML tools to register the XSD document created in the previous article in this series. You will use this document in a future article when I cover how to insert and work with XML data in DB2 9.

Note: This article series assumes that you have created the DB2 9 SAMPLE database using the following command: db2sampl –sql –xml. It also assumes that you have successfully added a connection to this database in the Visual Studio 2005 Server Explorer. For information about how to add a DB2 database connection to the Server Explorer, see “Addendum: Adding a DB2 Data Source to the Visual Studio 2005 Server Explorer” at the end of this article.

A Bit about Support for XML Schema Definitions in DB2 9

DB2 9 comes with a rich and flexible set of services for working with XSD documents. First and foremost, it should be noted that you don’t even need to have an XML Schema in order to store an XML document in DB2 9.

In DB2 9, the only prerequisite for storing an XML document using the pureXML feature is that the XML document be well formed. Although it’s outside the scope of this article to detail XML standards, a document is generally considered to be well formed if it has the following characteristics:

1.  It has exactly one root element. For example:

  • Well formed:
    <person>
      <fname>Mike</fname><lname>Kelly</lname>
    </person>
    
  • Not well formed:
      <fname>Mike</fname><lname>Kelly</lname>
    

2.  Each opening tag is matched by a closing tag. For example:

  • Well formed:
      <fname>Mike</fname><lname>Kelly</lname>
    
  • Not well formed:
      <fname>Mike<lname>Kelly</fname>
    

3.  All elements are properly nested. For example:

  • Well formed:
    <person>
      <fname>Mike</fname><lname>Kelly</lname>
    </person>
    
  • Not well formed:
      <fname>Mike</lname><lname>Kelly</fname>
    

4.  All attribute values are in quotes. For example:

  • Well formed:
    <person id="3431321">
    
  • Not well formed:
    <person id=3431321>
    

5.  The XML document does not contain any special or reserved keywords. For example:

  • Well formed
    <comments>Quantity on hand is &lt;5</comments>
    
  • Not well formed:
    <comments>Quantity on hand is <5</comment>
    

Fore more information about what constitutes a well-formed document, see: http://www.w3.org/TR/REC-xml. This is an important concept because if your document is not well-formed, you can’t store it in a pureXML column in DB2 9. While this requirement applies to documents stored in pureXML columns, you can still store schema-less XML documents in DB2 9. This adds to the flexibility and wide range of persistence services that DB2 9 provides for XML.

XML is all about flexibility. DB2 9, as you’ll find out the more you work with it, is pretty much the only relational database on the market today that really delivers on the flexibility promise of XML. For example, some other vendors require you to store your XML documents alongside a relational column while others always require an XML Schema to store XML.

You can associate different schemas with different columns in a table in DB2 9. This is yet another key flexibility point (again, central to XML) that isn’t shared by other vendors in their current implementation. For example, consider a wealth management company that’s involved in financial transactions for its clients around the globe. In the customer profile database, perhaps some clients actively trade while others are actively managed; each client type has a different process for its activities, and so on. If you had a different XML specification for each client type, in DB2 9, you can keep all your clients in one table, as opposed to having to separate them into different tables, since you can reference different XSDs in a single column.

But the flexibility of the DB2 9 XML Schema Repository (XSR) doesn’t stop there; perhaps the most important flexible design point is the fact that DB2 9 supports schema evolution. Schema evolution is a key concept to XML because it’s the basis of flexibility for which people choose XML.

For example, imagine that you have a set of clients each validating against the FpML v1.1 protocol, while others are at v1.2. How do you support these clients? Your database first has to support multiple schemas so that eliminates some vendors. But some vendors that support multiple schemas don’t allow their components to intersect, which means they don’t support schema evolution. DB2 9 allows you to support multiple editions and versions of those editions of XSDs to provide the utmost flexibility. After all, does everyone in your company, let alone your supply chain or partner companies, upgrade their software at the same time?

One final thing about validation – it’s a very useful and important feature when working with XML, but you should only use it when you need to use it. Validation of XML documents during insertion is a resource-intensive operation so it should be used only when needed. For example, you don’t encrypt data that isn’t subject to more stringent security requirements, do you? Keep this in mind when working with your XML documents.

Go to page: 1  2  3  Next  

Tools:
Add databasejournal.com to your favorites
Add databasejournal.com to your browser search box
IE 7 | Firefox 2.0 | Firefox 1.5.x
Receive news via our XML/RSS feed

DB2 Archives

Flash Demo: Learn how IBM Information Server Blade is easy to manage, highly scalable and efficient.
Five Trends for Application Development & Program Management. Download Complimentary Report Now.
IT in 2018: Download Free eBook By The Author Of "Does IT Matter?" Simple Registration Is Required.
Five Trends for Application Development. Download Your Complimentary Report. Exclusive. Act Now.
Download: Solaris 8 Migration Assistant. Run Solaris 8 apps on the latest SPARC systems and Solaris 10.


Latest Forum Threads
DB2 Forum
Topic By Replies Updated
database files move????? db2dba 1 March 25th, 09:02 AM
Missing objects in sysproc schema bocap 0 March 3rd, 07:44 PM
Linked Server - Connect to db2 rayan127 0 February 22nd, 02:10 PM
Difference in DB2 Date returned Indresh_Chadha 1 February 19th, 01:24 PM







JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
Microsoft Article: HyperV-The Killer Feature in WinServer ‘08
Avaya Article: How to Feed Data into the Avaya Event Processor
Microsoft Article: Install What You Need with Win Server ‘08
HP eBook: Putting the Green into IT
Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
Avaya Article: Setting Up a SIP A/S Development Environment
IBM Article: How Cool Is Your Data Center?
Microsoft Article: Managing Virtual Machines with Microsoft System Center
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Intel Video: Are Multi-core Processors Here to Stay?
On-Demand Webcast: Five Virtualization Trends to Watch
HP Video: Page Cost Calculator
Intel Video: APIs for Parallel Programming
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Sun Download: Solaris 8 Migration Assistant
Sybase Download: SQL Anywhere Developer Edition
Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
Red Gate Download: SQL Compare Pro 6
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
IBM Article: Collaborating in the High-Performance Workplace
HP Demo: StorageWorks EVA4400
Intel Featured Algorhythm: Intel Threading Building Blocks--The Pipeline Class
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES