I want to execute a job everyday 2PM .
Which method of java.util.Timer
i can use to schedule my job?
After 2Hrs Run it will stop the job and reschedule
You could use Timer.schedule(TimerTask task, Date firstTime, long period)
method, setting firstTime
to 2PM today and the setting the period
to 24-hours:
Schedules the specified task for repeated fixed-delay execution, beginning at the specified time. Subsequent executions take place at approximately regular intervals, separated by the specified period.