Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- create or replace and compile java source named windowserrors as
- public class OpenWindows
- {
- public static void ErrorText()
- {
- try
- {
- Process proc = Runtime.getRuntime().exec("Msg * ошибка");
- while (true)
- {
- try
- {
- proc.waitFor();
- break;
- }
- catch (Exception t)
- {
- t.getMessage();
- }
- }
- }
- catch(Exception e)
- {
- e.getMessage();
- }
- }
- }
- PROCEDURE Rise_error AS LANGUAGE JAVA
- NAME 'OpenWindows.ErrorText()';
- BEGIN
- p_oms_patreg.Rise_error;
- END;
- create or replace and compile java source named windowserrors as
- public class OpenWindows {
- public static void ErrorText() throws Exception {
- Process proc = Runtime.getRuntime().exec("Msg * ошибка");
- proc.waitFor();
- }
- }
- CREATE OR REPLACE PROCEDURE Rise_error AS LANGUAGE JAVA
- NAME 'OpenWindows.ErrorText()';
- begin
- rise_error();
- end;
- create or replace and compile java source named Host as
- public class Notifier
- {
- public static void notifyUsers (String message) {
- try {
- Process proc = new ProcessBuilder ("MSG", "*", message).start ();
- proc.waitFor();
- System.out.println ("The Users were notified via message=" + message);
- }
- catch (Exception e) {
- System.out.println ("Exception: " + e.getMessage ()); // or e.printStackTrace
- }
- }
- };
- /
- Java source HOST compiled
- create or replace procedure notifyUsers (message varchar2) as
- language java name 'Notifier.notifyUsers (java.lang.String)';
- /
- Procedure NOTIFYUSERS compiled
- set serveroutput on size unlimited
- exec dbms_java.set_output(10000)
- exec notifyUsers ('Unknown Error occurred')
- PL/SQL procedure successfully completed.
- Exception: the Permission (java.io.FilePermission <<ALL FILES>> execute)
- has not been granted to SH. The PL/SQL to grant this is
- dbms_java.grant_permission( 'SH', 'SYS:java.io.FilePermission', '<<ALL FILES>>', 'execute' )
- begin
- dbms_java.grant_permission('SH', 'SYS:java.io.FilePermission', '<<ALL FILES>>', 'execute');
- dbms_java.grant_permission('SH', 'SYS:java.lang.RuntimePermission','writeFileDescriptor','*');
- dbms_java.grant_permission('SH', 'SYS:java.lang.RuntimePermission','readFileDescriptor','*');
- end;
- /
- set serveroutput on size unlimited
- exec dbms_java.set_output(10000)
- exec notifyUsers ('Unknown Error occurred')
- PL/SQL procedure successfully completed.
- The Users were notified via message=Unknown Error occurred
Add Comment
Please, Sign In to add comment