Solved

run multiple java applications

Posted on 2006-10-31
12
272 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 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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

752 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