aspose file tools*
The moose likes JSP and the fly likes creating xml suing jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "creating xml suing jsp" Watch "creating xml suing jsp" New topic
Author

creating xml suing jsp

Sunesh Kumar
Ranch Hand

Joined: Oct 17, 2005
Posts: 89
Hi Friends,

I am developing an application in which i have to
1.insert values into database from xml
2.create xml using database values

in that i am successfull with first one , now i have to create an Xml file which is from all database tables...?

can u please your ideas with me...

bye...


Thanks & Regards<br />Sunesh Kumar Baachu
Satish SN
Ranch Hand

Joined: Apr 19, 2005
Posts: 70
Hi Sunesh,

i am not very much clear with u r second option ie u want to embed the database data from all tables into a xml file or all the data from a single table into a xml file.

the approach would be to use DOM to create a xml file and embed each value the way u want.

or try to build the xml file using the stringbuffer and manipulating the strings and finally write into a file using java.io


Satish SN<br />SCJP 1.4 & SCWCD 1.4
Krithika Srinath
Ranch Hand

Joined: Apr 11, 2006
Posts: 52
Hi Sunesh,

You can use SAX or DOM parsers for capturing data from database and converting them into XML file.

In your case, I would suggest you to go for SAX parser since you are dealing with Structured data (data generated from SQL).

You may find this article useful to startwith.

Regards,
~Krithika
Sunesh Kumar
Ranch Hand

Joined: Oct 17, 2005
Posts: 89
Hi Friends,

Your suggestions helped me a lot
Thanks yaar

Bye
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: creating xml suing jsp