• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

writing into xml as wells as into tables

 
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic