Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

run multiple java applications

Posted on 2006-10-31
12
Medium Priority
?
276 Views
Last Modified: 2012-06-21
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
Comment
Question by:at999
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
12 Comments
 
LVL 24

Expert Comment

by:sciuriware
ID: 17847770
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
 
LVL 92

Assisted Solution

by:objects
objects earned 200 total points
ID: 17848120
> 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
 
LVL 24

Expert Comment

by:sciuriware
ID: 17848132
>>> I want these application to run one after other
Let's assume that or it will be very complex.

;JOOP!
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 4

Assisted Solution

by:TheMajestic
TheMajestic earned 200 total points
ID: 17848301
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
 

Assisted Solution

by:DaBump
DaBump earned 200 total points
ID: 17849085
Look at the java open source scheduling technology called Quartz:

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

Good luck...
0
 
LVL 24

Accepted Solution

by:
sciuriware earned 400 total points
ID: 17849421
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
 

Author Comment

by:at999
ID: 17851739
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
 
LVL 24

Expert Comment

by:sciuriware
ID: 17851779
Yes.
0
 

Author Comment

by:at999
ID: 17852463
Does it depend on operating system?? - XP, NT Server etc?
0
 
LVL 24

Expert Comment

by:sciuriware
ID: 17852697
No
0
 
LVL 24

Expert Comment

by:sciuriware
ID: 17852759
The word 'batch' refers to a sequence, so it's the same everywhere
and has been over 50 years.

;JOOP!
0
 

Author Comment

by:at999
ID: 17852918
many thanks...:)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
In this post we will learn different types of Android Layout and some basics of an Android App.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Suggested Courses

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question