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
Boat Donations
KVM over IP
Compare Prices
Online Shopping
Domain registration
KVM Switches
Rackmount LCD Monitor
Server Racks
Data Center Solutions
Car Donations
Auto Insurance Quote
Web Design
Web Hosting Directory
Computer Deals




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. »

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

Justtechjobs.com Post A Job | Post A Resume
DB2
October 24, 2006
Creating an XML Schema Definition (XSD) document with the DB2 tools for 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 product, DB2 9. Part of this announcement included 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 product level 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-306.ibm.com/software/data/db2/express/download.html .

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 create an XML Schema Definition (XSD) document for subsequent registration into the DB2 9 XML Schema Repository (XSR) that’s part of the DB2 pureXML feature.

The steps in this article will show you how to create an XSD document that defines a complex data type (called CanadianAddress), which can be used in an XML document. Another XSD document will be created that includes the CanadianAddress XSD and optionally used to subsequently validate XML data in your DB2 9 database. Subsequent articles will build on this XSD and use it to perform various tasks like validation on insert, shredding, and so on - all from the Visual Studio IDE!

Creating an XSD in Visual Studio 2005

Visual Studio 2005 comes with a rich set of XML features so it’s great to know that the productivity delivered by these tools can be leveraged with DB2 9.

You can create data types for your XML document from within an XSD and have that data validated by DB2 9 as well.

To create an XML data type within an XSD, perform the following steps:

1.  Open a new file for editing by clicking New>File, and select XML Schema from the General tab:

2.  The XML Schema editor opens. Right-click in the middle of the designer pane, and select Add>New complexType:

Notice the IBM DB2 - Add to XML Schema Repository option from the pop-up menu? This feature gives you the ability to quickly and easily register an XSD in the DB2 9 XSR – more on that in a future article in this series.

3.  The XSD editor opens. Create a complex data type that will be used for Canadian-based addresses in your XML documents by performing the following steps:

a.   Change the name of the data type to CanadianAddress so that when you hover over the XSD editor it looks like this:

b.  Click-in the first empty cell, denoted with an asterisk (), and create an element called Address. (An appears beside the element name to identify it as an element.) Assign a String data type to it by clicking the drop-down arrow in the corresponding field and selecting string:

Note: The default action when you enter new rows in the XSD editor is to define those rows as elements. To define this manually, click the drop-down arrow in the box below the CT (for Complex Type) field in the XSD header, and select element from the drop-down list:

c.   Add the following elements to the complex CanadianAddress data type:

  • City
  • Province
  • Postal Code
  • Country

The XSD editor should now look like this:

When you are working with the XSD editor:

  • The asterisk () indicates that it is a new row.
  • The pencil () indicates that you are editing a current row.
  • The pointer () indicates the row that you currently have focus on for editing.

You can see the XSD-compliant XML code that is generated ‘behind-the-scenes’ by right-clicking the XSD editor and selecting View Code:

4.  If you look at the top of the XSD editors, you will notice asterisks appended to the name of each tab. This indicates that these pages contain unsaved changes:

Save your changes as CanadianAddress.xsd and then close the editor (by clicking ), as shown below:

Go to page: 1  2  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

Whitepaper: Enterprise Information Integration--Deployment Best Practices for Low-Cost Implementation
Download: Solaris 8 Migration Assistant. Run Solaris 8 apps on the latest SPARC systems and Solaris 10.
Webcast: Five Virtualization Trends to Watch. Produced for HP, Citrix, and Intel.
Flash Demo: Learn how IBM Information Server Blade is easy to manage, highly scalable and efficient.
Download: SQL Compare Pro 6--The fastest, easiest way to compare and synchronize two databases.


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