forked from Qualtagh/OracleDBUtils
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrunCommand.sql
More file actions
29 lines (27 loc) · 817 Bytes
/
runCommand.sql
File metadata and controls
29 lines (27 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
create or replace and compile java source named "org/quinto/admin/Command" as
package org.quinto.admin;
import java.io.File;
import java.io.IOException;
public class Command
{
public static void runCommand( String command )
{
try
{
String cmdArray[] = File.separatorChar == '/' ? new String[]{ "/bin/sh", "-c", command } : new String[]{ "cmd.exe", "/y", "/c", command };
Runtime.getRuntime().exec( cmdArray ).waitFor();
}
catch ( IOException e )
{
e.printStackTrace();
}
catch ( InterruptedException e )
{
e.printStackTrace();
}
}
};
/
create or replace procedure runCommand( tCommand in varchar2 ) is language java name
'org.quinto.admin.Command.runCommand( java.lang.String )';
/