Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Wierdness with Runtime().getRuntime().exec between 8.1.6 an 8.1.7
A Java SP that executes OS commands runs fine in 8.1.6, but doesn't run in 8.1.7 when a window is generated as a result of the call. The Java class follows:
package com.crtinc.oracle.util.osrun;
import java.io.*;
public class SimpleRunner extends Object {
public static void run(String cmd) throws IOException {
Runtime.getRuntime().exec(cmd);
}
}
The call spec follows:
CREATE OR REPLACE PACKAGE SIMPLERUNNER AUTHID CURRENT_USER AS
PROCEDURE RUN ("cmd" IN VARCHAR2)
AS LANGUAGE JAVA
NAME 'com.crtinc.oracle.util.osrun.SimpleRunner.run(java.lang.String)';
END SIMPLERUNNER;
When deployed to v8.1.6 by a user with JAVASYSPRIV, the following call from
SQL*Plus runs and displays a window:
exec simplerunner.run('notepad.exe');
When deployed to v8.1.7, the same call causes notepad.exe to be added to the
NT
Task Manager Processes tab, but the notepad window doesn't actually open up.
FWIW, the above code is a simple example - myactual utility captures the
output streams of OS commands, very much along the lines of sample code that
I've seen on Metalink - this also works fine in 8.1.6, but never returns in
8.1.7.
Granted, running Notepad is of limited utility (though it demos very well
:-),
but other useful OS commands that spawn a window (such as kicking of an
Oracle
Report, which pops up a small status window) do not run now in 8.1.7.
Running
a completely non-visual process seems to work fine, however.
Any help much appreciated!
Jim Stoll Received on Wed May 02 2001 - 08:40:05 CDT
![]() |
![]() |