PRB: Cannot Use JDBC in Applets Outside of Visual J++'s IDELast reviewed: January 29, 1998Article ID: Q179001 |
The information in this article applies to:
SYMPTOMSWhen programming an Applet that uses JDBC, everything works in the development environment. When the Applet is run outside of the development environment, the Applet throws a com.ms.security.SecurityExceptionEx.
CAUSEJDBC requires access to resources that are available only when outside the set of security restrictions placed on non-trusted Java Applets, also known as the "sandbox." Regular Applets cannot access files on the client's hard drive, access other network sockets, or print. JDBC requires file input/output. When trying to access a file on the client, the SecurityExceptionEx is thrown.
RESOLUTIONIn order for the Applet to work properly, you will need to create a cabinet file and digitally sign it (see references for more information). Then you need to add certain method calls in the Applet to "assert permissions" (please see article reference below) for file input/output.
STATUSThis behavior is by design.
REFERENCESFor documentation on digitally signing Applets, look at the SDK 2.0x documentation available at http://www.microsoft.com/java/sdk/. Open the documentation and select the link to "Tools," then "Creating and Using Cabinet Files for Java Applets and Libraries." For additional information, please see the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q175622 TITLE : PRB: SecurityExceptionEx Exception Running a Java AppletFor the latest Knowledge Base articles and other support information on Visual J++ and the SDK for Java, see the following page on the Microsoft Technical Support site:
http://support.microsoft.com/support/visualj/ http://support.microsoft.com/support/java/ Keywords : JDB Technology : kbInetDev internet Version : WINDOWS:1.0,1.1,2.0,2.01 Platform : WINDOWS Issue type : kbprb |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |