Creating a repeating date-scheduled event in a tomcat-hosted webapp
Dear All,
I am a fairly newish java developer, suddenly under pressure from a boss to come up with a solution, as detailed below. Any suggestions would be appreciated immensely!
I have written a small package which generates a series of PDF reports from a MySQL database. This package will be an add-on to a larger webapp. In terms of its function, there is no need for the package to contain servlets, JSPs etc. It only has to interact with the database, the main webapp and write files to the server's hard drive.
What I need to do is automatically run this package to generate the reports on the 30th of every month (or 28th in the case of February).
I have looked at a couple of options, including 1) Windows scheduled tasks and 2) on starting tomcat, loading/executing a servlet which has a timer to trigger the report generation.
However, option 1) appears to be too inflexible in terms of execution dates, and 2) I can't get the servlet to load/execute on Tomcat startup and also haven't yet been able to find a flexible enough timer.
So, the advice I need is:
What is the best trigger-timer combination to use for this task?
Thanks in advance,
Gavin Alexander

