Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Java in General and the fly likes How to run java application with specified time intervals..? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to run java application with specified time intervals..?" Watch "How to run java application with specified time intervals..?" New topic
Author

How to run java application with specified time intervals..?

lokesh pattajoshi
Ranch Hand

Joined: Jul 29, 2009
Posts: 130
Hi,
I have faced problem after visiting some online java sms portal..They have some features like you need to provide time and date(daily , weekly , monthly) and at that specified time they will send sms to you.so i think through scheduler this task can't be performed so can any body have idea how to implement this features...Your answer is appreciated.

Thanks and Regards
Lokesh
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4181
    
  21

You can use your operating system's built-in scheduler to run the java application (like Windows Scheduler or cron). Or you could use a third party scheduler like Quartz.


Steve
lokesh pattajoshi
Ranch Hand

Joined: Jul 29, 2009
Posts: 130
Hi Steve thanks for your replay.The interval value will come dynamically so except scheduler is there any other way to perform it..?
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14278
    
  21

Why do you think you cannot use a scheduler? A scheduler is exactly meant for that job: run a task at a certain time.

You could also have a look at class java.util.Timer and java.util.TimerTask.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
lokesh pattajoshi
Ranch Hand

Joined: Jul 29, 2009
Posts: 130
Thanks a lot Steve Timer class schedule method helped me..thanks for your valuable info..

bye
see you
cheer.......

Regards
Lokesh
 
 
subject: How to run java application with specified time intervals..?