Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 282
  • Last Modified:

run multiple java applications

I have to create a scheduled task in which i have to run  4 separate applications -

1. java -jar cleaner.exe  --- cleans a file
2. sqlldr  --to load clean data
3. java -jar regulator.exe ---- compares new data with old data
4. java -jar findposition.exe - finds position for each record.

I want these application to run one after other. So sqlldr should not run until cleaner has finished cleaning and so on...

Now if I create a single batch file to run all the above applications, will all of these run in a sequence?
0
at999
Asked:
at999
4 Solutions
 
sciuriwareCommented:
Yes, in an ordinary .bat they will run sequentially.


Another approach may be:

1) run them from another JAVA program
2) join them and call their 'main()'-s from another class

Everything is good.

;JOOP!
0
 
objectsCommented:
> Now if I create a single batch file to run all the above applications, will all of these run in a sequence?

depends on the application, and whether it completes processing before exitting.
0
 
sciuriwareCommented:
>>> I want these application to run one after other
Let's assume that or it will be very complex.

;JOOP!
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
TheMajesticCommented:
hi,

as mebtioned earlier in ordinary batch file it will run sequentially but there r prob .

so the best way i to use ant. in ant u can specify a dependency for a job to excute.that is for example the sqlldr will run only after the succesfull excution of its dependency job lets say cleaner.exe.

i think ant bulider is a best way to run this process.
0
 
DaBumpCommented:
Look at the java open source scheduling technology called Quartz:

http://www.java-source.net/open-source/job-schedulers/quartz

Good luck...
0
 
sciuriwareCommented:
Off topic!
the question was: Now if I create a single batch file to run all the above applications, will all of these run in a sequence?

And the answer is YES.

;JOOP!
0
 
at999Author Commented:
like if i type in a batch file -
notepad.exe
notepad.exe
notepad.exe

And if I run this batch file,
It wont open the next notepad until the previous one is closed!!!

Would the same thing happen with java.exe and sqlldr.exe???

0
 
sciuriwareCommented:
Yes.
0
 
at999Author Commented:
Does it depend on operating system?? - XP, NT Server etc?
0
 
sciuriwareCommented:
No
0
 
sciuriwareCommented:
The word 'batch' refers to a sequence, so it's the same everywhere
and has been over 50 years.

;JOOP!
0
 
at999Author Commented:
many thanks...:)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now