File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Listener code for any Database Updation

 
Subha Rajeswaran
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • 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?
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • 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
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • 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).
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic