aspose file tools*
The moose likes JDBC and the fly likes JDBC, Xml and servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC, Xml and servlets" Watch "JDBC, Xml and servlets" New topic
Author

JDBC, Xml and servlets

Harry Singh
Ranch Hand

Joined: May 02, 2001
Posts: 124
Hi,
i am just a starter . and i just wanna know how can i use xml, JDBC, and servlets together.. i mean can i use JDBC and XML together in a very effective manner... but thenwhat willbe the flow.. i am confused.. can anyone guide me through!!
harry
Joe McGuire
Ranch Hand

Joined: Mar 19, 2001
Posts: 293
Harry,
What is it you are trying to do? Do you want to use a servlet to retrieve a result set into an xml file?
XML is not a kind of relational database, so there really is no JDBC driver for XML. However, XML does have something that works the similarly: SAX.
SAX is an event based API for xml.
The details of using the sax parser to extract data into an xml file are fairly lengthy but straightforward. If you're interested there is an article in JavaWorld which details exactly how to this.
Hope this helps!
[This message has been edited by Joe McGuire (edited June 13, 2001).]
Andrew Shafer
Ranch Hand

Joined: Jan 19, 2001
Posts: 338

Harjinder,
The question is not can you use this or that technology together, but rather is this technology a good approach to solving my problem.
What are you trying to accomplish? If we know that, we can suggest technology that is suited to your goal.

!_I_Know_Kung_Fu_!
Anil Vupputuri
Ranch Hand

Joined: Oct 31, 2000
Posts: 527
If ur question is to combine all these technologies together, then here's the answer in breif.
First retrieve data from DBMS using JDBC and build a XML file using SAX or DOM API's. Then, use servlet to send this XML file to different server( XML is better chosen for EDI ie., in B2B scenario) and use parser at other side of server (use Servlet to get XML file over HTTP) to extract the XML file and update the database using JDBC.
Or else if u wanna send XML file to browser use some style sheets (XSL or CSS) to be displayed in browser as all browsers can't understand XML file, only IE(Internet Explorer) has built-in parser. U can use these style sheets at server-side or at client-side. there is a good explanation abt these XML/XSL forum.
HTH...
Anil


SCJP 1.5, SCEA, ICED (287,484,486)
Harry Singh
Ranch Hand

Joined: May 02, 2001
Posts: 124
hi Gurus,
Thanks!! i think i got what i wanted...
Cheers
HArry
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC, Xml and servlets