Is this Immpossible !!

Steve Muench smuench at
Wed Oct 20 08:05:29 BST 1999

If you're looking for a class library in Java that
will handle all of the SQL-to-XML rendering for you,
check out the Oracle XML SQL Utility at:

Given any JDBC connection "conn" and
any SQL query "q" you can do:

   OracleXMLQuery oxq = new OracleXMLQuery(conn,q);
   String result = oxq.getXMLString();

   to get the query results as a String, or

   String resultWithDTD = oxq.getXMLString(true);

   to get the query results as a String (with a dynamic DTD
   generated), or

   Document xmlDoc = oxq.getXMLDOM();

   to get the query results as an in-memory DOM Document

This is a robust implementation that works for any
valid SQL construct Oracle supports (including user-defined
structures and complex, dynamic object views) but
when working against another database will work fine
against its SQL as long as you have a JDBC driver for it.

The Oracle XSQL Servlet (new release out today, also
available at same URL) adds a convenient "page processing"
layer on top of this XML SQL utiltity to very easily
server XML documents based on multiple SQL statements
in a "datapage". The "datapage" can be returned as
a datagram over the web, or transformed using XSLT into
XML, HTML, or text by supplying an appropriate stylesheet
processing instruction in your "datapage".

Believe you'll find these do exactly what you're looking
for, depending on whether you want programmatic control
(XMLSQL) or simple way to deploy new data services without
programming (XSQL).

Steve Muench, BC4J Development Team & XML Evangelist
----- Original Message -----
From: Abhishek Srivastava <abisheks at>
To: xml dev mailing list <xml-dev at>
Sent: Tuesday, October 19, 1999 10:28 PM
Subject: Is this Immpossible !!

Hi All,

I have the following requirement. A client wants to query a database. It
sends out an SQL Query to the Database server. At the server side, instead
of returning a recordset, it returns an XML File.

The client on receiving the XML file, parsers it for "Validity" (to be sure
that all elements it had asked for are there).

Problem is that at the server side, How to build the xml document.
Presently, I am doing something like this

String("<Name>") + rs.getField("auName") + String("</Name>")

However, this is a very inelegant approach as the code is full of such
string concatenations.

Is there a more elegant solution to this ?  All the material on XML talks
about parsing and reading XML. What about writing them ? Are there DOM / SAX
Api extensions available that would
create "VALID" XML documents without clutter in the code ?

Any help would be greatly appreciated.

Thanks & Best Regards,
    _/               Abhishek Srivastava
   _/                Hewlett Packard ISO
  _/_/_/   _/_/_/    -------------------
 _/   /   _/  _/     (Work)   +91-80-2251554 x1190
_/  _/   _/_/_/      (Ip)
        _/           (Url)
       _/            You've heard it all by now. Get wired or get whacked.
                     You're networking or you're not working. Dot-com or die
                     - SUN MICROSYSTEMS

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at
Archived as: and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo at the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo at the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at

More information about the Xml-dev mailing list