javanetbeansglassfishtimer-jobs

How to create Timer Service using Java, Netbeans, and Glassfish


I want to have a method run every day at 3am that will summarize a production database and insert into another database. I've seen examples of the Timer services with Java but I'm not sure that is what I am looking for. I want the program to execute on its own with me having to worry about it starting up at 3am do its work and go to sleep until 3am the next day so and so on. Any Links to pre-existing questions, blogs, or guides will be much appreciated(if there are any), thanks.


Solution

  • The Quartz Scheduler library provides triggers to execute at a given date time or regular intervals (every day, every year, etc). You declare the schedule using a very simple trigger expression, like Cron.

    See these links for more information: