Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need to sync external database entries to xml file

 
Orangzaib Rajput
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all. I need some help. So far I have installed mysql database on my computer(ubuntu 12.04), this database is successfully acting as an external database to our device(debian based with working local database) and it is storing data in its table. I have written a code in java which is connecting to external database and creating an xml file successfully. Following is the code for that;



Now the problem is that I want to add new data from database into xml file automatically like as soon as database receive any data it just append those entries into xml file.

Please check and give me some notes or sample code for that.

After few response in other forums I have added following statement in my question.
I should correct my self as well explain my position in detail. We have a device which scanning wireless devices near by like smartphones and store their information in its database. I want to store that information into our central database in a specific formate so for that I installed another mysql server on my computer and received frames from device and then code the above program to formate the frames into a specific formate in an xml file so that I can send it to our even handler which will eventually update our central database. Now using this program I can create xml files from mysql database (installed in my computer) now my new task is to send only the new lines added into the xml file to event handler as you have described xml file should be small that is my mistake I don't want to append it. As mysql db is receiving frames continously after every few seconds and I just want to send those new frames in xml formate and for that I have been told I should use event handler (when new frames are received then perform difference between new and old xml file and then sen it in xml formate). I hope you have understood my question. Thank you.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds like your question is how to identify what in the XML is new. I can think of two approaches:
1) Keep XML of the current state and compare it in Java
2) Do a query to see if the data is there already
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic