The Artima Developer Community
Sponsored Link

Java Answers Forum
I run a command from Java

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
ahmad

Posts: 1
Nickname: ahmadnc
Registered: Aug, 2002

I run a command from Java Posted: Aug 19, 2002 10:53 PM
Reply to this message Reply
Advertisement
Hi All,
I run a command
Process p = null;
p = Runtime.getRuntime().exec(cmd /c imp username/password@serviceName file=d:\pbm\uploadedfiles\fileName.dmp full=y ignore=y);
p.waitFor();
p.destroy();

it opens dos window but dos window does not close itself and ther is situation of deadlock.
But if i use Thread.sleep(300) and //p.waitFor()...Its work fine and import the required data in oracle database and also dos window is closed.

But there is problem with Thread.sleep(300)....The code after the above mention code excutes before imoprting the data.So to avoid this I want to use p.waitFor() so that it should wait completeion the process of importing the data and then should go for execution of next code.

I m using operating system windows2000 Server and Tomcat as webserver.

Regards
Ahmad

Topic: System Shell in a Java Application Previous Topic   Next Topic Topic: applet

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use