Re: Is this Immpossible !!
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: http://technet.oracle.com/tech/xml 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 http://technet.oracle.com/tech/java http://technet.oracle.com/tech/xml ----- Original Message ----- From: Abhishek Srivastava <abisheks@i...> To: xml dev mailing list <xml-dev@i...> 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. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ _/ Abhishek Srivastava _/ Hewlett Packard ISO _/_/_/ _/_/_/ ------------------- _/ / _/ _/ (Work) +91-80-2251554 x1190 _/ _/ _/_/_/ (Ip) 188.8.131.52 _/ (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:xml-dev@i... Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1 To unsubscribe, mailto:majordomo@i... the following message; unsubscribe xml-dev To subscribe to the digests, mailto:majordomo@i... the following message; subscribe xml-dev-digest List coordinator, Henry Rzepa (mailto:rzepa@i...)
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format