Results 1 to 2 of 2
Thread: notify a DB change in java
- 12-28-2010, 11:58 AM #1Member
- Join Date
- Dec 2010
- Rep Power
notify a DB change in java
I have a list of jobs running in DB. sometimes those jobs gets errored out and the column STATUS Changes into ERROR. All i want to have is an exe file always running on my machine.and to notify me whenever the error gets changed. Any pointers on how this could be done.
- 12-28-2010, 01:46 PM #2
I guess start out by finding the SQL query to run on this job status table to determine when a job has failed. maybe something like
select count(*) form job_table where STATUS = 'ERROR';
Then create a thread that runs in an infinite loop and just sleeps for some interval like a minute or two, and then wakes up and invokes this query. If there is an error condition, have it print out a message to the console.
Then later on, create a Swing dialog that will pop up with the message instead.
And for finishing touches, investigate using the system tray feature (new in java 1.6) to have the application run as an icon in the system tray.
- By Mkaveli in forum Threads and SynchronizationReplies: 2Last Post: 03-30-2010, 12:58 PM
- By georges in forum Advanced JavaReplies: 4Last Post: 02-05-2010, 02:33 AM
- By Atriamax in forum Threads and SynchronizationReplies: 2Last Post: 12-09-2009, 03:51 AM
- By greyradio in forum Threads and SynchronizationReplies: 1Last Post: 08-03-2009, 04:36 AM
- By McChill in forum New To JavaReplies: 7Last Post: 06-03-2009, 10:17 PM