wood burning stoves 2.0*
The moose likes JDBC and the fly likes Listener code for any Database Updation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Listener code for any Database Updation" Watch "Listener code for any Database Updation" New topic
Author

Listener code for any Database Updation

Subha Rajeswaran
Greenhorn

Joined: Dec 30, 2008
Posts: 1
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
Marshal

Joined: Mar 22, 2005
Posts: 41052
    
  43
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


Ping & DNS - my free Android networking tools app
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41052
    
  43
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).
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Listener code for any Database Updation
 
Similar Threads
Possible work around for displaying blanks as default values for text fields tied to float-JSTL
Websphere Troubleshooting..
howto get total of rows from mysql
database connection code in PL/SQL
how to open a file using saved on database using java code