1. Oracle中java class的权限

    --远程连接ssh主机
    SQL>  exec dbms_java.grant_permission( 'BCSCM', 'SYS:java.net.SocketPermission', '*','connect,resolve' ) ;
    
    PL/SQL procedure successfully completed.
  2. 将java load到数据库

    [oracle@bcscm Java]$ loadjava -user bcscm/9Lyt8gRWZdjzSbj@BCSCM  Test.java -genmissing  # load java类,load过程同时会编译,数据库中会load源码及class文件
    [oracle@bcscm Java]$ loadjava -user bcscm/9Lyt8gRWZdjzSbj@BCSCM  Test.class -genmissing # 只load class文件
    [oracle@bcscm Java]$ loadjava -user bcscm/9Lyt8gRWZdjzSbj@BCSCM  -resolve jsch-0.1.42.jar -genmissing  # load jar包
    
  3. 创建函数或过程调用java

    create or replace function isConnected (host varchar2,user varchar2,password varchar2) return varchar as
            language java name 'Test.isConnected(java.lang.String,java.lang.String,java.lang.String) return java.lang.String';
  • No labels