Re: PL/SQL calls windows service

From: Lee <lee_at_jamtoday.com>
Date: Sat, 08 Jan 2005 22:57:26 -0500
Message-ID: <41E0ABA6.1080802_at_jamtoday.com>


>
>
>Since you are on 8i and if you have JServer installed, you can also use
>Java's Runtime object to run OS commands. e.g. compile and test this
>from a command line by passing any valid OS command or an
>executable/batch file as first parameter. You can easily modify and
>load this in the database as Java stored procedure.
>
>import java.lang.*;
>import java.io.*;
>import java.util.*;
>
>public class RuntimeTest {
>
>private static final String dquote = (char)34 +"";
>
>public static void main (String[] args)
>throws Exception {
>
>Runtime r = Runtime.getRuntime();
>Process p = r.exec("cmd /c " + dquote + args[0] + dquote);
>p.waitFor();
> }
>}
>
>
>
This is very slick, gives you the equivalent of the Sql*Plus "HOST" [Quoted] command, but isnt there a "permissions" problem?

There's code running inside oracle (the Java interpreter in this case) [Quoted] now that needs permission to execute cmd.exe .

I wonder why Oracle diddnt give us a "host" command in pl/sql "out of the box" ?

>
>
Received on Sun Jan 09 2005 - 04:57:26 CET

Original text of this message