tags:

views:

65

answers:

3

Hi!

I have a table in database with users and their expenses for traveling. I am using GWT and want to run a code once a month, that would query the database and send bills as PDFs to customers. I know how to create PDFs and send emails from servlet. How to run a program in java (or some other script if it isn't possible with java) that would run once a month?

Tnx

+1  A: 

To avoid "re-inventing the wheel" I suggest using http://www.freshbooks.com/ and tying your app into their API to send your bills. You can easily set up recurrence as a billing option so that the bills get re-sent (along with reminders) each month. The user can then grab the PDF version of their bill.

phirschybar
I have to do it myself because it is part of my seminar.
DixieFlatline
+2  A: 

Hi,

you have many choices.

If you are under Unix, the simpliest solution is a batch scheduled with a crontab.

If you prefer a 100% java solution, the Quartz framework is a robust a easy to setup solution.

Jean-Philippe Caruana
+3  A: 

Unix and derivatives: use cron -> http://en.wikipedia.org/wiki/Cron

Windows: use task scheduler -> http://support.microsoft.com/kb/308569

If you want to get fancy and do it purely in java: -> http://www.quartz-scheduler.org/, but do consider OS scheduler first.

Alexander Pogrebnyak