[转载]oracle调用JAVA授权问题
在oracle中需要发送Http请求时,如果没有设置账号的权限,当 connection.connect() 连接时,会报
ORA-29532: Java call terminated by uncaught Java exception: java.security.AccessControlException: the Permission (java.net.SocketPermission localhost:10000 listen,resolve) has not been granted to RADIUS. The PL/SQL to grant this is dbms_java.grant_permission( 'RADIUS', 'SYS:java.net.SocketPermission', 'localhost:10000', 'listen,resolve' )
ORA-06512: at "RADIUS.UDP_SEND", line 0
ORA-06512: at "RADIUS.WEB800CALLBACKITEMLIST_INS", line 20
ORA-04088: error during execution of trigger 'RADIUS.WEB800CALLBACKITEMLIST_INS'
ORA-06512: at "RADIUS.SF_CREATE800PHONECALLBACKNEW", line 25
ORA-06512: at line 1
解决办法是将你的登录用户权限提升。
解决办法:
1.打开 PL/SQL Develop 使用管理员账号登录数据库。
2.打开命令窗口
3.输入提成权限的命令 ,比如我用 'radius'账号登录,注意要大写,好像不识别小写
sql>exec dbms_java.grant_permission( 'RADIUS', 'SYS:java.net.SocketPermission', '112.64.35.222:1521', 'listen,resolve' );
sql>commit;
sql>exec dbms_java.grant_permission( 'RADIUS', 'SYS:java.net.SocketPermission', '192.168.0.123:8056', 'connect,resolve' );
sql>commit;
注意第一个 listen的是你的数据库地址,第二个connect的是你要发送http请求的地址
设置好这个权限后再发送请求就会发现你的账号可以成功向这个地址发送请求了