Solved

run multiple java applications

Posted on 2006-10-31
12
270 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
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 50 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
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.

 
LVL 4

Assisted Solution

by:TheMajestic
TheMajestic earned 50 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 50 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 100 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
diffSum example 4 50
Maven Project: Hibernate Dependencies Conflict 10 38
Why doesn't this text field show up on my Applet frame? 2 19
Running JavaFX on the Raspberry Pi 27 38
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…

840 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