1 / 9

XML Configuration in Java blog.davidroossien/?p=337

XML Configuration in Java http://blog.davidroossien.com/?p=337. David Roossien CS621 12/2009. Presentation Outline. 3 different ways to process XML configuration: DOM JDOM SQLXML Code Review - Interesting implementation details Singleton pattern Drivers (library / jar files)

Download Presentation

XML Configuration in Java blog.davidroossien/?p=337

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. XML Configuration in Javahttp://blog.davidroossien.com/?p=337 David Roossien CS621 12/2009

  2. Presentation Outline • 3 different ways to process XML configuration: • DOM • JDOM • SQLXML • Code Review - Interesting implementation details • Singleton pattern • Drivers (library / jar files) • XML SQL data type • Transform • Streams • Java Color class

  3. Configuration • Using XML for configuration is common, convenient and useful

  4. DOM Document • Document Object Model • http://java.sun.com/j2se/1.5.0/docs/guide/plugin/dom/index.html • org.w3c.dom.Document • http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/

  5. SAX Parser • https://jaxp-sources.dev.java.net/nonav/docs/api/javax/xml/parsers/SAXParser.html • SAX Parser can parse • InputStreams • Files • URLs • SAX InputSources

  6. JDOM • http://www.jdom.org/ • Makes it easier to parse than DOM (Java) • Jarfile: http://www.jdom.org/dist/binary/ • To use it, include the jdom.jar on the libraries tab as an “external jar” in your eclipse project

  7. SQLXML • SQLXML is a Java interface class • http://java.sun.com/javase/6/docs/api/java/sql/SQLXML.html • http://java.sun.com/javase/6/docs/api/java/sql/class-use/SQLXML.html

  8. XML in SQL Server 2005 • http://msdn.microsoft.com/en-us/library/dd571291.aspx • XML data type • http://www.w3schools.com/SQL/sql_datatypes.asp • no support in MS Access • SQL 2005 (2 GB limit)

  9. Conclusions • DOM • NodeList – iterate to find your element • JDOM - makes configuration easier • SQLXML – makes it possible to get XML data from a database

More Related