当前位置: 动力学知识库 > 问答 > 编程问答 >

java - applet does not run in browser

问题描述:

I am very new to Java, just completed a Java fundamentals coarse. already found a lot of answers and help on the diffenrent forums on the web.

I have designed an Applet with sql db access. Running it on NetBeans IDE 7.2.1, it works 100%, but as soon as i run it with a .html file with the NetBeans view command, I get the following error.

äccess denied "java.lang.RuntimePermission" "accessClassInpackage.sun.jdbc.odbc"

I have already added the following lines to the java policy file in the jre directory.

permission java.lang.RuntimePermission "accessClassInPackage.sun.jdbc.odbc", "read";

permission java.lang.RuntimePermission "accessClassInPackage.sun.jdbc.odbc", "write";

permission java.util.PropertyPermission "file.encoding", "read";

permission java.util.PropertyPermission "file.encoding", "write";

what am i doing wrong, or what is required to run the applet in the browser?

网友答案:

I don't think that applets can open JDBC connections from sandbox. You probably have to sign your applet something like this

http://www.qoppa.com/faq/signapplet.htm

分享给朋友:
您可能感兴趣的文章:
随机阅读: