Results 1 to 2 of 2
  1. #1
    amanda is offline Member
    Join Date
    Dec 2010
    Posts
    1
    Rep Power
    0

    Default 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

  2. #2
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    684
    Rep Power
    6

    Default

    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
    Java Code:
    select count(*) form job_table where STATUS = 'ERROR';
    Then create a [Java?] program to connect to the database with the appropriate credentials and invoke this query.

    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

  1. Need help with wait() and notify()
    By Mkaveli in forum Threads and Synchronization
    Replies: 2
    Last Post: 03-30-2010, 11:58 AM
  2. Wait() notify() implementation
    By georges in forum Advanced Java
    Replies: 4
    Last Post: 02-05-2010, 01:33 AM
  3. wait() and notify() trouble with UI
    By Atriamax in forum Threads and Synchronization
    Replies: 2
    Last Post: 12-09-2009, 02:51 AM
  4. wait() and notify() problems
    By greyradio in forum Threads and Synchronization
    Replies: 1
    Last Post: 08-03-2009, 03:36 AM
  5. Make a program notify
    By McChill in forum New To Java
    Replies: 7
    Last Post: 06-03-2009, 09:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •