Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run method at a certain time of the day

Status
Not open for further replies.

Pichdude

Programmer
Aug 24, 2005
66
SE
Hi,

I am wondering if it is possible to have a method run at a certain time of a day? I want to send and e-mail to all users that have an unanswered message stored in the database of the CRM system I am building. The message should be sent i.e. at 3PM every day.

Regards

Pichdude
 
Please do not post standard Java questions in the J2EE forum in the future. Non-J2EE questions should be posted here : forum269 .

With regards to your question, read up on this class :
--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Hi again (sorry to bump this thread)

I am wondering, is the Timer class the best solution for wanting to do something at the same time every day? It looks like it sets a delay (for example 24h) for when it is suppose to do it next time. But it adds the delay to when it is finished so if it take a few seconds to do the task everytime it will be a small displacement everytime. Is there any better solution in Java or do I have to settle with this?

Best regards

Pichdude
 
Have you tried rescheduling the timer after each time it executes ?

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
No I have not, thanks for the great tips!

Best regards
 
Just an opinion: wouldn't it be better to use OS features to do that?

Cheers,
Dian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top