简体   繁体   中英

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM