Click to See Complete Forum and Search --> : Help! RMI with jdbc-odbc bridge


October 6th, 1999, 05:52 AM
Hi!
Please look at the codes below...

1:import java.rmi.RMISecurityManager;
2:
3:public class TNet {
4: public static void main(String[] args) {
5: if(System.getSecurityManager() == null)
6: System.setSecurityManager(new RMISecurityManager());
7:
8: try {
9: Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
10: } catch(ClassNotFoundException ce) {
11: System.out.println(ce.getMessage());
12: ce.printStackTrace();
13: }
14: }
15:}

I want to make a RMI application.
I thought that RMI application would go well with jdbc-odbc bridge.
However, I've gotten some problem since I just started.
I got an Exception,"java.security.AccessControlException", at Line 9.
If I remove Line 5 and 6, there is no exception.
Yes, I can make my RMI application without setting security manager
to RMISecurityManager.
I think, however, there might be some security problem.

Have anyone made a RMI application or applet using jdbc-odbc bridge?
I do need your help.
Thanks in advance.

poochi
October 6th, 1999, 09:13 AM
Have you specified the policy file when you run this application ?

Save the following line in a file called "Policy.txt"



grant{
permission java.security.AllPermission;
};





and try running your application like this ..



C:> java -Djava.security.policy=Policy.txt MyRMIServer

October 6th, 1999, 09:42 PM
Dear, poochi

Thank you for your help.
I've forgotten policy file.

Thank you once more.

poochi
October 7th, 1999, 12:13 AM
you are welcome..