applet and jdbc
i have done an intranet chat.it is working fine.now i want to make it as internet chat.i have done using swing and frame.when i am calling this frame in a applet,it throws exception like java.security.AccessControlException: access denied(java.lang.RuntimePermission accessClassInPackage.sun.jdbc.odbc)
why it is throwing the exception ?Is it because of JdbcOdbcDriver? should i use any other driver with applet ? which driver shall i use ?
[461 byte] By [
knssmi] at [2007-9-26 2:51:41]

Hi,
I am not sure that whether you are trying to write or delete a file in your chat application through the applet. But generally this type of access denied error occurs because of it. Please try to use the Policy file which can be created by policy tool command.
Creation of policy file and where it can be stored is very well documented in this URL.
http://java.sun.com/docs/books/tutorial/security1.2/tour1/index.html
Also this problem may arise if you use older version of Netscape. Try to download newer version, or use the java plugin to utilize the JDK1.2 event handling model.
The Plugin will overcome certain security exception in
Applet.
Please download the plugin from this URL.
http://java.sun.com/plugin
I hope this will help you.
Thanks
Bakrudeen
i am not write or delete any file and i am running the applet using appletviewer.i am attaching the code which throws exception below
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
path="jdbc:odbc:venkdsn";
con=DriverManager.getConnection(path);
stnt=con.createStatement();
}
catch(Exception e1)
{
System.out.println("e1 ex: "+e1);
}
please help me
knssmi at 2007-6-29 10:39:07 >

Hi,
It is just an approach, Try to create a policy by going to URL, give the path what you have set and give the file permission as connect, accept and then run the appletviewer with the security manager ie with the policy file.
Still if it did not work, try downloading the javaplugin.
I hope this will help you
Thanks
Bakrudeen