Audit fields rely on them being used. It's not clear from Anshul's problem description that that would be the case. In fact, it's not clear at all how the DB is used. Given that, I'd say the problem description is too vague to advise on anything.
Piyush Mangal wrote:How are you updating your mysql database? You need to have some kind of audit fields in your database table. Whenever a record is updated, you update the audit fields i..e updatedBy , lastUpdated. Now you can have a quartz scheduler which can poll these audit fields and based on the lastUpdatedtime can send out emails to the desired recipients.
It's not clear what the OP really wants here, but it sounds like this is a case where DB triggers might help.
Set up a trigger on each of the relevant tables to respond to the changes you are monitoring for, and let it write an entry to a log table (or file) with the information you want to know about. Then poll this log to get the latest changes. By using triggers, you can distinguish between inserts/updates/deletions, and it means the DB takes care of responding to the initial events which may be on multiple tables, while you only have to look in one place - the log - to see what's changed. This will probably be more efficient than constantly polling your original data tables in case they've changed, especially when nothing is happening on your DB or if your data tables are large.
But be careful with your triggers e.g. don't let your triggers make changes to other tables that have their own triggers, or you'll end up cascading changes around your DB like crazy!