Home » Developer & Programmer » JDeveloper, Java & XML » Calling OS command using Java procedure in PL/SQL generates NON-EXISTANT PROCESS on NT
Calling OS command using Java procedure in PL/SQL generates NON-EXISTANT PROCESS on NT [message #91624] Fri, 13 December 2002 14:54 Go to next message
Alain Labonté
Messages: 1
Registered: December 2002
Junior Member
Hello, we are using a procedure called "executecmd" that is a Java procedure used to call an Operating system command (we're under NT 4.0). But when we call a batch file (Ex: test.bat), the system executes the program correctly, but let a Non-Existant Process on the server. Do you have any idea of what might cause that bug?

Here the java program :

create or replace and compile java source named executecmd as
import java.lang.Runtime;
import java.lang.Process;
import java.io.IOException;
import java.lang.InterruptedException;

class ExecuteCmd {

public static void main(String args[[]]) {

System.out.println("In main");

try {
/* Execute the command using the Runtime object and get the
Process which controls this command */

Process p = Runtime.getRuntime().exec(args[[0]]);

/* Use the following code to wait for the process to finish
and check the return code from the process */
try {

p.waitFor();

/* Handle exceptions for waitFor() */

} catch (InterruptedException intexc) {

System.out.println("Interrupted Exception on waitFor: " + intexc.getMessage());
}

System.out.println("Return code from process"+ p.exitValue());

System.out.println("Done executing");

/* Handle the exceptions for exec() */

} catch (IOException e) {
System.out.println("IO Exception from exec : " +
e.getMessage());
e.printStackTrace();
}
}
}

Thank you
Re: Calling OS command using Java procedure in PL/SQL generates NON-EXISTANT PROCESS on NT [message #91635 is a reply to message #91624] Thu, 19 December 2002 06:33 Go to previous messageGo to next message
kwan
Messages: 3
Registered: November 2002
Junior Member
How to call OS command for linux? Using the same method?
Re: Calling OS command using Java procedure in PL/SQL generates NON-EXISTANT PROCESS on NT [message #91637 is a reply to message #91635] Thu, 19 December 2002 07:07 Go to previous message
Mahesh Rajendran
Messages: 10694
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
u can also use this one from
AskTom
Previous Topic: USing XML SAX Parser in PL/SQL
Next Topic: Returning Resultset from a proc - Oracle vs MS SQL
Goto Forum:
  


Current Time: Sat Jul 24 16:38:15 CDT 2021