The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
September 2000



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


Re:Applets and jdbc drivers

Posted by Venkata Nukala on September 21, 2000 at 1:16 PM


You can try creating a jar archive (say test.jar) which has
your main class as well as driver classes and use
archive="test.jar" in applet tag of html page.


> Hello,

> I am trying to write a Java applet to access a mysql database. I have written a rudimentary Java application that uses the JDBC driver for mysql (downloaded from your site as a binary) and returns data to the screen just fine when run from the Unix shell. When I convert the same application into an Applet, I get an "unable to load mysql driver " exception after the following lines are executed:

> try{
> Class.forName("").newInstance();
> }
> catch (Exception E) {
> System.err.println("Unable to load mysql driver");
> }

> This same code works fine in the application version.

> The applet is running on a SCO Unix Openserver 5.0.5 server. I am using JDK 1.2. The browser is MS IE5 on Windows 98. I have installed version 1.3 of the Java Plug-in in order to be able to run 1.2 applets and swing components.

> Is there anything I need to do on the Windows side of things to get this to work? Does the mysql/JDBC driver need to be in the same directory as the applet on the server? Any help or direction would be greatly appreciated.

> - Joel Levitan
> Omega Institute


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us