I have a question:
I have a series of servlets that allow users to interact with a
database. One feature I would like to add, is to have an automated
email sent to me once a week to notify me of any changes that were
made. I already have the code in place to send this to me on my
command, but I would like a way for this to happen, say for example,
every friday evening.
Could someone recommend to me a course of action on how to do this?
Currently, all my code is done in Java, so doing it through that would
be ideal.
Thanks in advance,
Matt
jhr - 25 Jul 2006 21:50 GMT
> I have a question:
>
[quoted text clipped - 11 lines]
> Thanks in advance,
> Matt
If on unix, run your current progam via a cron job.
Otherwise, you can use the java.util.Timer to schedule this type of
action using its scheduleAtFixedRate method. This requires you to
implement you email app as a java.util.TimerTask.
Tajonis - 26 Jul 2006 19:56 GMT
> > I have a question:
> >
[quoted text clipped - 17 lines]
> action using its scheduleAtFixedRate method. This requires you to
> implement you email app as a java.util.TimerTask.
another option would be to utilize Quartz
http://www.opensymphony.com/quartz/ it provides a rather extensive API
for scheduling.