How to write a java code that will execute itself depending on system time
3 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ritu_kumar
Posted On:   Thursday, May 3, 2001 06:22 AM

I have to run a java class that executes automatically either based on system time ie 11 am, 12 noon... etc. OR run every hour .

Re: How to write a java code that will execute itself depending on system time

Posted By:   Alex_Chaffee  
Posted On:   Monday, May 21, 2001 01:30 PM

Re: How to write a java code that will execute itself depending on system time

Posted By:   Alex_Brdar  
Posted On:   Thursday, May 3, 2001 07:28 AM

If you are using JDK1.2 or higher then you could try using the
java.util.Timer object. You will need to extend the
java.util.TimerTask class (which is really just Runnable with
two extra methods) and call the Timer.schedule or
Timer.scheduleAtFixedRate methods to run every hour with your
TimerTask object.

Re: How to write a java code that will execute itself depending on system time

Posted By:   Venkat_r  
Posted On:   Thursday, May 3, 2001 06:53 AM

One solution to this problem is to make a shell script or dos command
script file, depending on your OS, to call your java programs
from this script and then place this sript in either "cron tab" or "nt service".

Other wise make a "while true" loop application and from this application
call other java classes depending on the system time..
About | Sitemap | Contact