every first day of the month ..the report has to be generated..taking a records from the date base ...(by taking from and to date)
can anyone help me ....how to Schedule..for a .. month...
Thanks to all...
Joined: Jan 29, 2003
Assuming you have a JVM that will be up all the time, say an app server that never restarts: compute the next time the report should run, compute the milliseconds between then and now, make a Java Timer that will wait that long and then execute and compute a new next time.
Because JVMs don't stay up forever, you probably need to persist the "next scheduled run" in a file or database or whatever. At JVM startup, read the stored time and set up the Timer.
Or invest a little time in learning Quartz which does all this and more.
Any of that seem to work for your problem?
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi