• Post Reply Bookmark Topic Watch Topic
  • New Topic

scheduling jobs through java  RSS feed

 
deekasha gunwant
Ranch Hand
Posts: 396
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
i'm back with yet another query.
My java/oracle project's requirement is to run some Oracle procedures at a particular time interval () as specified by the user.
can anybody pls. give me some hints about how can i write a scheduler in java so that i can continuously fire those oracle procedures after a certain interval of time.
i'd like to put a related query here in case some oracle ppl are here.actually we wrote a simple scheduler using the dbms_job.submit() function of oracle.but sometimes this scheduler does not work at all without reporting any errors .
and because of this we have to look for scheduling through front-end.
all replies are appreciated
regards
deeksha


 
Jim Baiter
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the java.util.Timer class (1.3 only). The API
doc for this has a pretty good description of how you could
accomplish your goal.
 
deekasha gunwant
Ranch Hand
Posts: 396
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Jim,
I'll go through it and get back to u.

regards
deeksha
 
Mirko Froehlich
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alternatively, you can always use an external scheduling mechanism, such as a cron job in Unix. Personally, I feel more comfortable doing this than having a Java application that is constantly running and does its own scheduling. Either way should work fine, though.
-Mirko
 
Mark Herschberg
Sheriff
Posts: 6037
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problemw with the timer class, as Mirko pointed out, is that the java application must always be running. You could take the java application and turn it into a service (on NT), or something similar on other OS. Sun recently started a JCP on daemon (JSR-96), but it'll be a while before they are available.
Defering it to another program is your best bet
--Mark
heshey@vaultus.com
 
deekasha gunwant
Ranch Hand
Posts: 396
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mark,
My application will be running on NT.can you pls. elaborate on
You could take the java application and turn it into a service
i mean how is it done?
regards
deeksha

 
Gopala Krishna
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you downloand Microsoft SDK for java(it's free) it come with a tool which converts java program into sevice.
Pl go to following link you can find help on how to make a java program into NT service:
http://msdn.microsoft.com/library/periodic/period99/vji9902_ntserv.htm
Originally posted by deekasha gunwant:
Hi Mark,
My application will be running on NT.can you pls. elaborate on
[b]You could take the java application and turn it into a service

i mean how is it done?
regards
deeksha
[/B]

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!