Java Reference
In-Depth Information
Part IV: Using Databases, JDBC,and
XML
Chapter List
Chapter 17 : The XML Document Object Model and JDBC
Chapter 18 : Using Rowsets to Display Data
Chapter 19 : Accessing XML Documents Using SQL
Part Overview
XML is a text-based markup language that is fast becoming a standard for data management and
interchange, both within an application and between applications on and off the Web. Although at first
glance an XML document looks much like an HTML Web page, there are significant differences
between the two. The foremost of these can be summed up as follows:
 
HTML is primarily used to mark up text and other data with formatting information.
 
XML is primarily used to structure data, either for transport or for an application's local use.
In other words, HTML documents are primarily document-centric (that is, they are designed primarily for
human consumption). XML documents, on the other hand, are primarily data-centric (that is, they are
primarily intended for machine use where some degree of human readability is desirable).
Web pages, obviously, are typical examples of document-centric applications. Examples of typical data-
centric XML applications include:
 
Messaging between applications via the SOAP protocol. This is primarily used by the new Web-
services paradigm.
 
Remote procedure calls over HTTP using XML-RPC
 
Data transport, such as the delivery of stock quotes or news headlines over the Internet
 
Initialization functions that used to be handled by .ini or .properties files.Tomcat's web.xml
is a good example of an initialization file implemented with XML.
 
Scripting in such applications as the build language ANT. The ANT build file is XML based.
Data-centric documents are also typically characterized by a regular structure, frequently because they
are machine generated. Document-centric material is frequently less regularly structured, as humans
generate it. The content of data-centric documents frequently either originates in a database, in which
case the XML document is used to publish it, or is intended to be stored in a database, in which case
the XML is used to transport it there.
In some instances, an XML document, being a data repository, can be a database in itself. For example,
the contact lists on my Linux-based PDA are saved as XML documents.
The chapters in Part IV discuss working with databases and XML. Chapter 17 reviews retrieving data
from a table and formatting the ResultSets as XML, as well as fetching XML data from the Internet
and saving the data to a table. The JDBC RowSet is discussed in Chapter 18 , and Chapter 19 goes on
to look at creating a simple JDBC driver that allows you to access XML documents using SQL.
Note
This distinctions drawn between HTML and XML deliberately overlook the fact that well-
formed HTML is a particular application of XML. In terms of common usage, the
distinction is valid.
Search WWH ::




Custom Search