File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Scheduler in Java Application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Scheduler in Java Application " Watch "Scheduler in Java Application " New topic
Author

Scheduler in Java Application

saiprasad raut
Ranch Hand

Joined: Aug 29, 2003
Posts: 40
HI All,

I am working on a project in which client will schedule that he want a perticular report to be mailed to him according to the schedule he set.

Lets take an example:
Client schedules REPORT1 to be mailed to him after every week( lets say every monday)

I am maintaining a column in my SQL server 2000 database as 'Next_Runnung_Date' .

I have 2 optoins:
1. I will write a SQL job which will daily run and check the 'Next_Run_Date' column. If this matches the server current date then it should call the Java Class (But i dont know how can i call Java Class with parameter from SQL server 2000)

2. Write a Java Class (with threads) this thread will sleep for 24 hrs and after 24 hrs it will wake up and go to the database check the 'Next_running_date' column and accordingly call the other java class......
(But due to the thread ..it will affect my server performance...)

IS there any ohter way to do? is anybody of you have came across such situations before???

Please let me know...
Thanks in advance...

Saiprasad
zmarak ahmad djan
Greenhorn

Joined: Sep 02, 2004
Posts: 20
java.util.Timer is not costly
(but I have never used it with such a wide gap ... have a try)


zmarak (publican)
Abhi Yadav
Greenhorn

Joined: Sep 09, 2004
Posts: 6
U can refer a java API for scheduling the jobs
check this link
www.quartzscheduler.org
zmarak ahmad djan
Greenhorn

Joined: Sep 02, 2004
Posts: 20
therer are also schedulers in java.util.concurrent packages in J2SE5
but wait until next year
saiprasad raut
Ranch Hand

Joined: Aug 29, 2003
Posts: 40
Thank you all for your replies!!!

Cheers!!
Saiprasad
SCJP1.4
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Look at Flux if you evaluate a set of commercial schedulers. They have persistent timers that reside in the database when you shut down and come back to life when you start up again. Oh, wait, that may be our application doing that.

http://www.simscomputing.com/products/flux/whitepapers/
[ September 10, 2004: Message edited by: Stan James ]

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Caesar Dutta
Ranch Hand

Joined: Sep 18, 2004
Posts: 30
If I am not mistaken a Java program can be converted to exe. There are
some utilities I believe at download.com. So if I write a program and
then schedule it through the windows schedular is there a problem ?

Kindly let me know.

Regards,

Caesar
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

There is a api, called 'quarz' or 'quartz', where you may schedule multiple jobs in a crontab - manner.


Cesar: why do you need to convert the program to exe, to run it by the windows-scheduler?

Sorry Abhi Yadav, you mentioned quartz, inclusive link - have overseen it.
[ September 24, 2004: Message edited by: Stefan Wagner ]

http://home.arcor.de/hirnstrom/bewerbung
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Scheduler in Java Application
 
Similar Threads
NX: RandomAccessFile / Singleton DataSchema
auto-increament in ms sql server2000
Interview Pattern - India vs. Singapore
Help(Client Fails to read from Server)
Error Message