1

I am running automatic tests and after each test, all the sessions of these tests are automatically inserted into a temporary table. My tool (in JAR), checks this temporary table and when it finds a new session inserted, my tool scans it and then delete this entry from the temporary table.

Actually I can do that manually without any problem (telling my tool to check the temporary table, if there is something new, scan it…), but I want to do that automatically, I mean my tool always running, and checks automatically (for example every hour) if there is something new in the temporary table.

Could you help me how I can do that ? I guess I need a server where I execute my tool 24/24, which type of server? Thank you very much

Learthgz
  • 133
  • 12
  • Quartz is a very good library for executing scheduled tasks. Alternatively, if you're on a Linux system, you can set up a cron job? – christopher Aug 25 '15 at 07:58
  • The software utility Cron is a time-based job scheduler. U need to create a Cron. – Bacteria Aug 25 '15 at 08:00
  • if you are on windows [this](https://www.google.de/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CCEQFjAAahUKEwjVqvr94cPHAhXFfhoKHcNvDGY&url=http%3A%2F%2Fstackoverflow.com%2Fquestions%2F15783553%2Frun-a-jar-file-using-windows-scheduler&ei=jSDcVZWwPMX9acPfsbAG&usg=AFQjCNFdM6lu99sOixTMbaV7ynaZSbND6Q&cad=rja) could also help – SomeJavaGuy Aug 25 '15 at 08:01

2 Answers2

2

If you are on a unix based system, you could run the jar as a cronjob. The following would run a jar every 30 seconds.

*/30 * * * * java -jar /path/to/jar/myjar.jar

Read the following to learn how to setup a cronjob correctly https://askubuntu.com/questions/2368/how-do-i-set-up-a-cron-job

For windows, use task scheduler. https://stackoverflow.com/a/26932169/802061 as suggested by @kevin-esche in the comments

Community
  • 1
  • 1
Faheem Sohail
  • 806
  • 8
  • 21
0

Which database you are using. If SQL, you can create the jobs in the database server itself.

Varun Selva
  • 46
  • 1
  • 8