dbms_pipe往随便一个程序发消息,另一个程序执行。

解决方案 »

  1.   

    在触发器中是否可以写类似 "shutdown "的语句呢?
      

  2.   

    没有尝试过,不过觉得触发器中应该没有权限执行shutdown immediate这类的语句
      

  3.   

    帮忙看看,编译都通过,触发器也有效,但看不到执行效果:
    CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED RunDx AS
    import java.io.*;                                                               
    public class RunDx{                                                         
      public static String Run(){                                     
         try{                 
    System.out.println("success");
    Runtime.getRuntime().exec("D:"); 
    Runtime.getRuntime().exec("cd D:\mulu");    
    Runtime.getRuntime().exec("shutdown.bat");//要执行的批处理文件,实现关闭的功能          
            return("0");                                                                  
         }                                                                          
         catch (Exception e){                                                       
            System.out.println("Error running command: \n" + e.getMessage());    
            return(e.getMessage());  
         }                                                                          
      }                                                                             
    }
    /create or replace procedure RunDx  
    as language java  
    name 'RunDx.Run()';
    /
    set serveroutput on size 5000
    call dbms_java.set_output(5000);
    exec RunDx ;