import java.io.FileWriter;
import java.io.IOException;public class OracleTriggerJava {
public static void main(String[] args) {
try  {
           FileWriter fw  =   new  FileWriter( "c:/MO_WriteData.txt" );
            //  将字符串写入文件 
           fw.write( " Hello google, MOService started ! " );
           fw.close();
       }  catch  (IOException e) {
        e.printStackTrace(); 
       } }

public static void modify(String memo){
try  {
           FileWriter fw  =   new  FileWriter( "c:/MO_WriteData.txt" );
            //  将字符串写入文件 
           fw.write( " Hello google, MOService started !----begin " );
           fw.write( memo ) ; 
           fw.write( " Hello google, MOService started !----end " );
           fw.close();
       }  catch  (IOException e) {
        e.printStackTrace(); 
       }
}}
这是OracleTriggerJava.java代码,但是写入权限的时候
C:\Windows\system32>sqlplus / as sysdbaSQL*Plus: Release 11.2.0.1.0 Production on 星期一 5月 23 10:12:42 2016Copyright (c) 1982, 2010, Oracle.  All rights reserved.
连接到:
Personal Oracle Database 11g Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL> Begin
  2  dbms_java.grant_permission('jkt','SYS:java.io.FilePermission','c:\MO_WriteData.txt','read,write,execute,delete');
  3  end;
  4  /
Begin
*
第 1 行出现错误:
ORA-29532: Java 调用被未捕获的 Java 异常错误终止:
oracle.aurora.vm.IdNotFoundException: jkt : user or role id does not exist
ORA-06512: 在 "SYS.DBMS_JAVA", line 793
ORA-06512: 在 line 2
出错