中国IT动力,最新最全的IT技术教程
最新100篇 | 推荐100篇 | 专题100篇 | 排行榜 | 搜索 | 在线API文档
首 页 | 程序开发 | 操作系统 | 软件应用 | 图形图象 | 网络应用 | 精文荟萃 | 教育认证 | 硬件维护 | 未整理篇 | 站长教程
ASP JS PHP工程 ASP.NET 网站建设 UML J2EESUN .NET VC VB VFP 网络维护 数据库 DB2 SQL2000 Oracle Mysql
服务器 Win2000 Office C DreamWeaver FireWorks Flash PhotoShop 上网宝典 CorelDraw 协议大全 网络安全 微软认证
硬件维护  CPU  主板  硬盘  内存  显卡  显示器  键盘鼠标  声卡音箱  打印机  机箱电源  BIOS  网卡  C#  Java  Delphi  vs.net2005
  当前位置:> 程序开发 > 编程语言 > Java > Java与XML
Why We Need XML Query Standards @ JDJ
作者:未知 时间:2005-08-10 19:01 出处:Java频道 责编:chinaitpower
              摘要:Why We Need XML Query Standards @ JDJ

Despite a shortage of sophisticated XML query tools, Internet demands have forced companies to present their data in various formats. In one sense little has changed, as SQL queries have long been used to combine data for different purposes and audiences. Now however, the output is XML, and while the tools used to generate or consume XML may be different, the structure is similar to structures created by traditional report writers.

Relational databases have neither hierarchy nor sequence, but XML uses both to structure data. This is a good match for the way XML data is used. Most Web sites use data from relational databases, though it rarely looks relational on a Web page. Nobody wants to present users with a series of two-dimensional tables, telling them how to join the tables in their minds to see the relationships. Instead, relational data is used to build hierarchical representations of the data for users. Similarly, most Web messages have a strongly hierarchical organization that looks nothing like the relational tables. For both Web sites and Web messages, data is generally exchanged as XML. Web sites convert the XML to HTML using stylesheets, and Web messages exchange data directly as XML.

Companies basically have four choices when deciding how to use relational data in XML applications - custom coding, proprietary XML extensions from database vendors, SQL 2003's SQL/XML extensions, and XQuery.

Any of these approaches can be used, but they have very different ramifications for the architecture of software systems.

Custom programming is probably the most widespread approach to integrating XML and relational data. These programs use JDBC or ODBC to issue SQL queries to query the database, create XML structures using APIs like DOM or SAX, and use XSLT to transform structures or format XML for display as HTML.

This approach is standards-based and portable but requires much tedious coding, and the same information is often represented in several intermediate formats. This code is difficult to maintain when new formats are required or existing formats change. It is tricky to make these applications perform well, and not usually cost effective since new programming is needed for each desired format.

Relational vendors have long recognized the need for integration with XML, providing SQL extensions and other tools for their products. These tools vary widely in quality, performance, and usability and have been important for the evolution of our understanding of XML query languages. For companies that can afford to rely on only one database vendor, proprietary tools can be a good alternative to custom coding, though they are inherently nonportable.

Recognizing the need for a standard for adding XML support to relational databases, INCITS, ANSI, and ISO have added XML publishing functions to SQL 2003. These functions are easy to learn and allow any desired XML structure to be created. As part of the SQL language, the full power of SQL is available to structure data; for an experienced SQL programmer, this is the simplest tool that solves the problem well, and it fits well into existing relational infrastructure. Portable implementations of SQL/XML are commercially available, using the standard JDBC API to access query results.

The W3C has designed the XQuery language to query XML in the same way that SQL queries relational data. Input and output of an XQuery are XML, and XQuery works efficiently for XML views of data sources that are not represented as XML. Most relational vendors are implementing XQuery based on SQL/XML views of their relational tables, and some third-party tools can provide XML views of any relational database, allowing data to be combined with XML files or XML represented using SAX or DOM in a program. Likely to become a Recommendation soon, XQuery easily combines multiple data sources making it a clear winner for data integration.

.  .  .

Both XQuery and SQL/XML are extremely useful for businesses that need a portable way to query their data to produce XML. XQuery is more powerful for data integration, and fits better into many XML environments. SQL/XML fits well into existing relational infrastructure, and requires little new learning from programmers.

关闭本页
 
首页 | 投资与合作 | 服务条款 | 隐私政策 | 收藏本站 | 设为首页 | 新用户注册 | 免责声明 | 使用帮助
Copyright ©2005-2008 chinaitpower.com All rights reserved. www.chinaitpower.com 版权所有