Presentation is loading. Please wait.

Presentation is loading. Please wait.

XML Configuration in Java David Roossien CS62112/2009.

Similar presentations


Presentation on theme: "XML Configuration in Java David Roossien CS62112/2009."— Presentation transcript:

1 XML Configuration in Java David Roossien CS62112/2009

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

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

4 DOM Document Document Object Model Document Object Model lugin/dom/index.html lugin/dom/index.html lugin/dom/index.html lugin/dom/index.html org.w3c.dom.Document org.w3c.dom.Document Level-3-Core / Level-3-Core /

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

6 JDOM Makes it easier to parse than DOM (Java) Makes it easier to parse than DOM (Java) Jarfile: Jarfile: To use it, include the jdom.jar on the libraries tab as an external jar in your eclipse project 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 SQLXML is a Java interface class sql/SQLXML.html sql/SQLXML.html sql/SQLXML.html sql/SQLXML.html sql/class-use/SQLXML.html sql/class-use/SQLXML.html sql/class-use/SQLXML.html sql/class-use/SQLXML.html

8 XML in SQL Server us/library/dd aspx us/library/dd aspx us/library/dd aspx us/library/dd aspx XML data type XML data type pes.asp pes.asp pes.asp pes.asp no support in MS Access no support in MS Access SQL 2005 (2 GB limit) SQL 2005 (2 GB limit)

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


Download ppt "XML Configuration in Java David Roossien CS62112/2009."

Similar presentations


Ads by Google