Lists Home |
Date Index |
- From: "Steve Muench" <email@example.com>
- To: "Abhishek Srivastava" <firstname.lastname@example.org>
- Date: Tue, 19 Oct 1999 23:09:34 -0700
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
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
Steve Muench, BC4J Development Team & XML Evangelist
----- Original Message -----
From: Abhishek Srivastava <email@example.com>
To: xml dev mailing list <firstname.lastname@example.org>
Sent: Tuesday, October 19, 1999 10:28 PM
Subject: Is this Immpossible !!
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
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) 126.96.36.199
_/ (Url) http://sites.netscape.net/abhishes/homepage
_/ 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:email@example.com
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:firstname.lastname@example.org the following message;
To subscribe to the digests, mailto:email@example.com the following message;
List coordinator, Henry Rzepa (mailto:firstname.lastname@example.org)