Results 1 to 2 of 2
Thread: notify a DB change in java
- 12-28-2010, 10:58 AM #1
Member
- Join Date
- Dec 2010
- Posts
- 1
- Rep Power
- 0
notify a DB change in java
Hi All,
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.
Thanks,
Amy
- 12-28-2010, 12: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
Then create a [Java?] program to connect to the database with the appropriate credentials and invoke this query.Java Code: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.
Similar Threads
-
Need help with wait() and notify()
By Mkaveli in forum Threads and SynchronizationReplies: 2Last Post: 03-30-2010, 11:58 AM -
Wait() notify() implementation
By georges in forum Advanced JavaReplies: 4Last Post: 02-05-2010, 01:33 AM -
wait() and notify() trouble with UI
By Atriamax in forum Threads and SynchronizationReplies: 2Last Post: 12-09-2009, 02:51 AM -
wait() and notify() problems
By greyradio in forum Threads and SynchronizationReplies: 1Last Post: 08-03-2009, 03:36 AM -
Make a program notify
By McChill in forum New To JavaReplies: 7Last Post: 06-03-2009, 09:17 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks