Is this Impossible !!
Steve Muench
smuench at us.oracle.com
Thu Oct 21 18:53:45 BST 1999
You need to decide what is an acceptable
client interface for your server-side app.
*Mark's* point about SQL is totally valid
if what that means is that end-users
would have to type-in SQL statements as
their "user experience".
*Your* point about not querying XML is totally
valid since the database is going to do
that querying and sorting much faster over
non-trivial amounts of data than
doing it in an XML document.
A compromise is some kind of servlet that
lets the user provide parameters to pre-defined
SQL statements that they don't have to understand.
For example, using the Oracle XSQL Servlet, I can
deploy a page on my webserver that looks like:
======== employee.xsql ===========================
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="table.xsl"?>
<query>
SELECT firstnmame, lastname, birthday
FROM employees_table
WHERE ('{@lastname}' IS NOT NULL AND
LASTNAME LIKE '%{@lastname}%')
AND ('{@firstname}' IS NOT NULL AND
FIRSTNAME LIKE '%{@firstname}%')
</query>
======== employee.xsql ===========================
And then they can request (likely through an HTML
form that they fill out) a URL like:
http://yourserver/employee.xsql?lastname=jones
They'll get the info they are looking for without
writing SQL themselves.
If you leave off the <?xml-stylesheet?> then they'll
get the raw XML results of the query.
________________________________________________________
Steve Muench, BC4J Development Team & XML Evangelist
http://technet.oracle.com/tech/java
http://technet.oracle.com/tech/xml
----- Original Message -----
From: AlanM <AlanM at SYNECTICS.Soft.net>
To: <xml-dev at ic.ac.uk>
Sent: Thursday, October 21, 1999 9:11 AM
Subject: RE: Is this Impossible !!
|
| Hi guys,
| Since speed is criteria is it faster to send Queries to the server in SQL
or
| XML. If sent in XML we will have to parse it and then convert it into SQL
| again, which may slow down the process.
|
|
| > -----Original Message-----
| > From: Mark Birbeck [SMTP:Mark.Birbeck at iedigital.net]
| > Sent: Thursday, October 21, 1999 8:29 PM
| > To: xml dev mailing list
| > Subject: RE: Is this Impossible !!
| >
| >
| >
| > Hi everyone,
| >
| > Very busy so can't give you in depth on this, but I note that you are
| > using VB scripting so here is a bit of code from a VB script version of
| > our SOAP server.
| >
| > It's not that complicated, but it provides you with an easy way to
create
| > a results set from any values. For example, it could build a node list
| > from a three element array, with the first element being another array
| > that contains record sets, the second being an integer, and the third
| > being an XML DOM node (should you want to).
| >
| > Note that it copes with nested recordsets - which is great if you are
| > using the Microsoft data shaping facility in ADO. In fact using this
| > routine and data shaping is probably the easiest way to get an XML
| > document with real structure out of a relational database.
| >
| > Two quick things that are slightly off theme:
| >
| > First - if you are returning XML you should really consider querying in
| > XML. The client should not really be sending SQL queries since you are
not
| > returning a SQL result set. You should accept an XML query (say, using
| > XPath) and then convert that on the server to an SQL query. That way the
| > fact that your data is currently relational will be hidden (since it may
| > change).
| >
| > Second - for those interested - note how much better SOAP structure is
| > than XML-RPC! I've fallen for it!!
| >
| > Best regards,
| >
| > Mark Birbeck
| > x-port.net Ltd.
| >
| >
| >
| > -----Original Message-----
| > From: Goyal, Sanjeev [mailto:Sanjeev.Goyal at usa.xerox.com]
| > Sent: Thursday, October 21, 1999 2:49 PM
| > To: 'Abhishek Srivastava'
| > Cc: xml dev mailing list
| > Subject: RE: Is this Impossible !!
| >
| >
| > Abhishek,
| >
| > Most of the XML Parser implementations provides mechanism to
| > generate well formed XML documents from the DOM Tree. I have used sun's
| > XML parser, it provides APIs to generate well-formed XML from your
| > Document Node.
| >
| > Hope it helps.
| > Sanjeev
| >
| > -----Original Message-----
| > From: Abhishek Srivastava [mailto:abisheks at india.hp.com]
| > Sent: Wednesday, October 20, 1999 1:29 AM
| > To: xml dev mailing list
| > 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) 15.10.47.37
| > _/ (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
| >
| > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| >
| > << File: SOAP Return.asp >>
|
| xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
| Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on
CD-ROM/ISBN 981-02-3594-1
| To unsubscribe, mailto:majordomo at ic.ac.uk the following message;
| unsubscribe xml-dev
| To subscribe to the digests, mailto:majordomo at ic.ac.uk the following
message;
| subscribe xml-dev-digest
| List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)
|
|
xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo at ic.ac.uk the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)
More information about the Xml-dev
mailing list