Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> dbms_java.grant_permission

dbms_java.grant_permission

From: <suneel.nani_at_gmail.com>
Date: 19 Apr 2006 21:32:57 -0700
Message-ID: <1145507577.551952.203110@e56g2000cwe.googlegroups.com>


create or replace procedure two(id number) AS LANGUAGE JAVA
NAME 'Receive.two(int) ';
/

create or replace procedure reciveidandsend AS LANGUAGE JAVA
NAME 'Receive.reciveidandsend() ';
/

public class Receive {
static Socket []mysocket = new Socket[20]; static DataOutputStream []D = new DataOutputStream[20]; static int i=0;
public static void reciveidandsend () throws IOException, IllegalArgumentException,SecurityException,EOFException {

  InetAddress I = null;
  I= I.getByName(null);
  int PortNumber =5342;

  ServerSocket MyServerSocket = null; // we listen using this socket   Socket mySocket = null; // this is the one on which we get this data   MyServerSocket = new ServerSocket (PortNumber);   while(true){
  mysocket[i] = MyServerSocket.accept();   D[i]= new DataOutputStream(mysocket[i].getOutputStream()); i++;

}
}

public static void two(int x)throws IOException{ for(int a=0;a<i;a++)
{
D[a].writeInt(x);

}
}
}

i have written two procedures which call this java class Receive 1) to open server socket
2) to send information to clients

but when i am executing i am getting error java.security.AccessControlException: the Permission (java.net.SocketPermission
143.43.209.12:34066 accept,resolve) has not been granted to CS522S8. The PL/SQL
to grant this is dbms_java.grant_permission( 'CS522S8', 'SYS:java.net.SocketPermission', '143.43.209.12:34066', 'accept,resolve' )
ORA-06512: at "CS522S8.RECIVEIDANDSEND", line 1 ORA-06512: at line 1

it is reading wrong port number 34066 but i gave 5342 when i am executing it is giving other portnumber

and i also got the grant permission on this port number5342 can any one give suggestion on this
thank you very much Received on Wed Apr 19 2006 - 23:32:57 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US