janand
janand

Reputation: 11

Java Code to Schedule a SQL file to execute on specific date and time on UNIX machine

I am new to java, and looking for assistance to write a code in java which takes abc.sql file from local machine and execute it on specific date and time on unix server under given data space.

Upvotes: 1

Views: 963

Answers (2)

Keshav Saharia
Keshav Saharia

Reputation: 983

Use the cron utility. You should read the man pages on it by executing

man cron

But if you're lazy (like me) and don't like reading man pages (like me), you could just Google this and find some good tutorials, like

http://www.thegeekstuff.com/2009/06/15-practical-crontab-examples/

In the cron job you make, set the command to run the Java file, just as you would type it in the Terminal to execute it normally.

Upvotes: 1

user1352498
user1352498

Reputation:

Use Quartz as the library. If you know how to use webapps in Java there´s a Servlet within Quartz that start and stop the lib factory automaticaly for you.

http://quartz-scheduler.org/

Examples: http://quartz-scheduler.org/documentation/quartz-2.x/examples/

Hope this can help you.

Upvotes: 1

Related Questions