- 论坛徽章:
- 0
|
我在JBuilder 8中编写了一个Applet(使用了Swing)访问Oracle数据库,程序运行完全正常。于是将自己编写的类和classes111.zip一起打包到一个jar文件中:
====================DBApplet.jar文件的结构====================
DBApplet.class
DBApplet$1.class
...
DBApplet$14.class
javax\ //javax\sql\XXX.class
meta-inf\
oracle\ //oracle的相关类
==============================================================
并在Html文件中用"archive=XXX.jar"指定包路径:
====================DBApplet.html文件的内容===================
<p>;
<applet archive = "DBApplet.jar"
width="580" height="500"
code="DBApplet.class"
codebase="./">;
</applet>;
</p>;
==============================================================
可是当我转到IE中用Plug-in(版本:1.4.1_02,平台:XP+SP1)执行的时候,控制台上显示信息如下:
java.security.AccessControlException: access denied (java.net.SocketPermission 192.9.200.30:1521 connect,resolve)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:270)
at java.security.AccessController.checkPermission(AccessController.java:401)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:542)
at java.lang.SecurityManager.checkConnect(SecurityManager.java:1044)
at java.net.Socket.connect(Socket.java:420)
at java.net.Socket.connect(Socket.java:376)
at java.net.Socket.<init>;(Socket.java:291)
at java.net.Socket.<init>;(Socket.java:119)
at oracle.net.nt.TcpNTAdapter.connect(TcpNTAdapter.java)
at oracle.net.nt.ConnOption.connect(ConnOption.java)
at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java)
at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java)
at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java)
at oracle.net.ns.NSProtocol.connect(NSProtocol.java)
at oracle.jdbc.ttc7.TTC7Protocol.connect(TTC7Protocol.java)
at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java)
at oracle.jdbc.driver.OracleConnection.<init>;(OracleConnection.java)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at learnswing.DBApplet.btnConnectActionPerformed(DBApplet.java:286)
at learnswing.DBApplet.access$1(DBApplet.java:6)
at learnswing.DBApplet$2.actionPerformed(DBApplet.java:142)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1764)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1817)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
at java.awt.Component.processMouseEvent(Component.java:5134)
at java.awt.Component.processEvent(Component.java:4931)
at java.awt.Container.processEvent(Container.java:1566)
at java.awt.Component.dispatchEventImpl(Component.java:3639)
at java.awt.Container.dispatchEventImpl(Container.java:1623)
at java.awt.Component.dispatchEvent(Component.java:3480)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3165)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
at java.awt.Container.dispatchEventImpl(Container.java:1609)
at java.awt.Component.dispatchEvent(Component.java:3480)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
我怀疑可能是Plug-in的属性没有设置好,有人知道怎么解决这个问题吗?郁闷死了!推荐几篇Plug-in的文章也行啊!谢谢! |
-
2.jpg
(134.76 KB, 下载次数: 57)
在IE里运行的情况
|