PRB: Cannot Use JDBC in Applets Outside of Visual J++'s IDE

Last reviewed: January 29, 1998
Article ID: Q179001
The information in this article applies to:
  • Microsoft Visual J++, versions 1.0, 1.1
  • SDK for Java, versions 2.0, 2.01

SYMPTOMS

When 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.

CAUSE

JDBC 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.

RESOLUTION

In 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.

STATUS

This behavior is by design.

REFERENCES

For 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 Applet

For 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


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: January 29, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.