• 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

Listener code for any Database Updation

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi i need to implement a thread class which will monitor that any new record i.e(insertion) has been added in the database table. Please give me the code?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

JavaRanch is NotACodeMill, so you'll need to write this code yourself. But we'll gladly help you learn enough that you can do that.

But first, since this question has nothing to do with the SCWCD exam -which is what this forum is all about- I'll move it to a more appropriate forum. CarefullyChooseOneForum
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could either write a DB trigger for that table -if the action to be taken can be handled in the DB-, or periodically check the number of records in that table (using something like "select count(*) from ..."). If doing the latter you'd need to account for deleted records (if that can happen in your case).
 
reply
    Bookmark Topic Watch Topic
  • New Topic