This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes SQL Statements in XML document Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "SQL Statements in XML document" Watch "SQL Statements in XML document" New topic
Author

SQL Statements in XML document

Sandeep Shahane
Greenhorn

Joined: Nov 16, 2005
Posts: 8
I'm new to XML. I wish to store all my application SQL statements in an XML file. Can anybody please guide me where can I find XML strucutre for the same and XML parsers also.
Is using XML for storing SQL statements is a good practice ?






Sandeep L. Shahane<br />SCJP 1.4, SCWCD J2EE 1.4, <br />SCBCD J2EE 1.3 ...
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

For beginners, just use the XML parser (and other tools) built into Java (1.4 or later). There are many ways to store SQL statements in XML. The simplest is like this:

<SQL>Select name, address from supplier</SQL>

Or you could break the statement up into its parts and store them in separate elements. I would suggest learning the basics of XML before you make any decisions on how to use it.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: SQL Statements in XML document
 
Similar Threads
Running .sql File in java
Trigger Function Problem
complex sql statements questions in interview, need info for job, please help!
How to trace SQL statements ?
XML reporting and look query