我创建了一个简单的小程序 ( Java 1.7.0_07
),我尝试在其中连接到 Oracle 数据库 ( ojdbc6.jar
)。该小程序在我的 IDE 的小程序查看器中运行良好,但无法从 Web 正确运行。
我遇到了安全异常,所以我签署了 jar 文件,认为可以修复它,但我仍然遇到安全异常,即:
java.security.AccessControlException: access denied ("java.util.PropertyPermission" "oracle.jdbc.RetainV9LongBindBehavior" "read")
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
at java.lang.System.getProperty(Unknown Source)
at oracle.jdbc.driver.PhysicalConnection$1.run(PhysicalConnection.java:3147)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.jdbc.driver.PhysicalConnection.getSystemProperty(PhysicalConnection.java:3143)
at oracle.jdbc.driver.PhysicalConnection.readConnectionProperties(PhysicalConnection.java:736)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:519)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:228)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at com.ericr.signedApplet.SignedApplet.init(SignedApplet.java:61)
at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter.init(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
我一直在用头撞墙,试图让事情井井有条,关于如何设置的信息似乎相互矛盾。
所以......甚至有可能做我想做的事吗?如果是这样,是否有指南让我知道我需要在安全方面做什么才能让小程序在从 Web 访问时正常工作?
谢谢...