aspose file tools
The moose likes JDBC and the fly likes Listener code for any Database Updation Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply 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: 35241
    
    7
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


Android appsImageJ pluginsJava web charts
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35241
    
    7
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).
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Listener code for any Database Updation
 
Similar Threads
Websphere Troubleshooting..
Possible work around for displaying blanks as default values for text fields tied to float-JSTL
howto get total of rows from mysql
how to open a file using saved on database using java code
database connection code in PL/SQL