Example 6-32: Granting privileges to connect to an external website

BEGIN
    -- Grant Permission to set the proxy* System properties
    dbms_java.grant_permission(
             grantee => 'XMLBOOK',
     permission_type => 'SYS:java.util.PropertyPermission',
     permission_name => 'proxySet',
   permission_action => 'write');
    dbms_java.grant_permission(
             grantee => 'XMLBOOK',
     permission_type => 'SYS:java.util.PropertyPermission',
     permission_name => 'proxyHost',
   permission_action => 'write');
    dbms_java.grant_permission(
             grantee => 'XMLBOOK',
     permission_type => 'SYS:java.util.PropertyPermission',
     permission_name => 'proxyPort',
   permission_action => 'write');
    -- Grant Permission to resolve and connect to URL at *.yahoo.com
    dbms_java.grant_permission(
             grantee => 'XMLBOOK',
     permission_type => 'SYS:java.net.SocketPermission',
     permission_name => '*.yahoo.com',
   permission_action => 'connect,resolve');

  COMMIT;
END;