Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Invoking a program automatically??  RSS feed

 
Jyothsna Sri Y
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hiii
I have a java program, which needs to be called in regular intervals, like say about every half an hour. It has to contact the database and if any un processed rows exist, it has to collect them a definite number at a time and process.
The program should be checked if it is currently running and if it is not, it has to be invoked.
Please reply asap.
Thanks
Regards
Jyothsna
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want a pure java solution, look into one of the two timer classes: java.util.Timer or javax.swing.Timer. You will probably have to tie your program to the operating system so it will be preserved between reboots. If you are running some Unix derivative, investigate cron jobs. If you are running some Windows NT (2000, XP) OS, look into AT, or do a search of these discussion forums for "windows service".
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!