The java.util.Timer and TimerTask classes can schedule events that occur in regular intervals (e.g., every 24 hours), or at specific points in time (e.g, every Friday night at midnight). See here for examples e367 and e368.
Joined: Feb 05, 2007
Thanks Ulf! But how can I run something like this example on server? When start app server must run something like servlet... or something else ,who looking for time
Joined: Mar 22, 2005
Assuming you have a web app, you can run code at web app startup time by configuring a ServletContextListener and its contextInitialized method.