• 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

Need to sync external database entries to xml file

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
I found a beautiful pie. And a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic