Run java thread at specific times

前端 未结 3 828
孤城傲影
孤城傲影 2020-12-19 06:29

I have a web application that synchronizes with a central database four times per hour. The process usually takes 2 minutes. I would like to run this process as a thread a

3条回答
  •  再見小時候
    2020-12-19 06:55

    TimerTask handles this case.

    See schedule(TimerTask, Date)

    If you don't want to have to keep scheduling the jobs, you may want to look into a job scheduling tool like Quartz.

提交回复
热议问题