Home > AS/400 Tips > WebSphere Strategies for iSeries professionals > Other options for generating XML or storing XML in a database
iSeries 400 Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

WEBSPHERE STRATEGIES FOR ISERIES PROFESSIONALS

Other options for generating XML or storing XML in a database


Jim Mason, Search400.com expert
12.11.2003
Rating: -4.67- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


XML to SQL Java classes for dynamic selection
WDSC also provides two Java classes to do the same thing dynamically: SQLToXML and XMLToSQL. They are stored in two jar files:sqltoxml.jar and xmltosql.jar. Although you do some basic Java coding here to use these classes, it doesn't require learning the details of XML SAX or DOM parsers.

If we have the wizards that are easy to use, why bother with Java coding examples to do the same thing? The Java classes allow you to specify the selection criteria for the queries at runtime. You may want to embed these functions as built-in services in your own application. In that case, you may want to use these IBM classes. They are nice to use because they don't require you to buy any extra prorietary software (see the DB2 XML Extenders below).

Buy DB2 XML Extenders to map XML to SQL
WDSC also has an RDB-to-XML mapping editor that can create a definition (Data Access Definition) to insert XML documents into an SQL table in a DB2 database. This tool is a lot more powerful than the basic SQL-to-XML wizard but requires you to buy IBM's DB2 XML Extender -– an expensive add-on to DB2 on the iSeries -– to run the DAD and load XML to DB2. If you won't be programming in Java, need complex XML to SQL mapping support and plan on doing lots of XML applications, this high expense might be justified.

Using Java to parse XML documents vs. RPG
RPG allows you to call API programs. IBM supplies an XML parser on the iSeries that COULD be used to write your own custom parser logic. Do other consultants and IBMers teach you how to do this? Sure. Do I think this is a good idea? Absolutely not! While RPG is a great language for writing business logic on an iSeries server, there are MANY scenarios YOU would recognize RPG is a bad solution to a problem. (Writing a navigational system for a rocket that continuously calculates its course is another example.)

WDSC and Java offer MANY options and levels of parsing support for XML by comparison:

  • WDSC's XML to SQL wizard -- No coding at all
  • IBM's SQLToXML class or Apache's Commons Digester class to search and parse complex documents -- about five or six lines of Java typically
  • JAXB support (Java for XML binding) in the latest web services standards pack from Sun -- about five to 10 lines of Java to create Java objects from XML
  • Using the JDOM framework to create Java DOM objects (from www.jdom.org)
  • Complete custom parsing logic using Xerces SAX and DOM parsers in Java (still a lot less work than RPG)

Return to main tip, Generating XML from SQL data.


Rate this Tip
To rate tips, you must be a member of Search400.com.
Register now to start rating these tips. Log in if you are already a member.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Web Tools
Putting data from IBM i on Amazon S3 using i2S3
TAATOOL: Useful tools for programmers on IBM i
Programming for the Web on the IBM i, what is possible
Zend Web software teams up with IBM System i
Using geocoding on AS/400 to enhance your Web presence
The iSeries Blog has a new home on IT Knowledge Exchange
The best technologies and tools for System i programmers in 2009
Search400.com Products of the Year 2008
Application modernization strategies for System i
Natively supported Web applications for Power running i

Web Development
Implementing a browser interface in COBOL: Creating your graphic Web page
Implementing a browser interface in COBOL: Getting started
IBM i shop boosts online sales with RPG-based Web platform
Migrating from RPG to EGL on IBM i
Groovy programming on IBM i
Running PHP open source applications: NOBODY needs authority
Zend Web software teams up with IBM System i
The best technologies and tools for System i programmers in 2009
Seven IBM i project lessons learned in 2008
AS/400 lessons from the past, present, and future: A holiday tale

Web Servers
System i no longer the stepchild of IBM's world
Connecting WebSphere to AS/400 for image retrieval
Weaving in WebSphere
SOA enhancements drive IBM WebSphere feature packs
SOA means money for IT workers
Enable J2EE app on WAS to access DB2
Securing Apache: Keeping patches current
IBM runs USOpen.org on Power boxes
MoMA's IT makeover a mix of old and new
How does RPG talk to a browser?

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
WebSphere Development Studio Client (WDSC)  (Search400.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



iSeries Security - Security Tools, Physical Security and System Security
HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersProducts
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts