Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

writing into xml as wells as into tables

 
kesava chaitanya
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in our project requirement like this;we have database tables like this
Country
States
City
in the jsp forum , fields like this
country:........
state:........
city:.........
when i submit the FORUM corresponding fields should enter into database as well as should create one xml file
like this:
<?xml version='1.0'?>
<root>
<country>india</country>
<state>karnataka</state>
<city>bangalore</city>
</root>
when i enter different fields in the forum and enter submit; the xml should overwrite with the previous values like this;
<?xml version='1.0'?>
<root>
<country>india</country>
<state>karnataka</state>
<city>bangalore</city>
<country>india</country>
<state>tamilnadu</state>
<city>chennai</city>
</root>
can anybody provide any links how to do this ?can i use xml schema for this
application
bye
chaitu
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you got two thigns to do on submit event.
1. load to database
2. Write/update XML file
For writing to a table. You can use jdbc api to to connect and use any database, A good tutorial is available here.
For writing/updating xml.
I can think of two options now.
1.Read the database table and create an xml file using simple File IO
2.Create an XML, and edit/modify/remove them using DOM api.
IBM has a basic tutorial on understanding DOM
Having a schema is is always better for future applicaiton upgrades and maintainability, data exchange and presentations etc., BUT not really necessary.
 
kesava chaitanya
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Balaji Loganathan:
So you got two thigns to do on submit event.
1. load to database
2. Write/update XML file
For writing to a table. You can use jdbc api to to connect and use any database, A good tutorial is available here.
For writing/updating xml.
I can think of two options now.
1.Read the database table and create an xml file using simple File IO
2.Create an XML, and edit/modify/remove them using DOM api.
IBM has a basic tutorial on understanding DOM
Having a schema is is always better for future applicaiton upgrades and maintainability, data exchange and presentations etc., BUT not really necessary.


thank u for ur suggestion?what about JDOM?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic