[ale] MySQL and Java

Jason Day jasonday at worldnet.att.net
Wed Nov 12 23:42:35 EST 2003


On Tue, Nov 11, 2003 at 08:24:47PM -0500, Emil P. Man wrote:
> I am trying to access MySQL through some Java applets. I do not have any 
> experience with writing applets for MySQL yet. So here is my issue. I 
> have downloaded the JDBC driver from MySQL's web site, and tried 
> installing it. I installed java in /usr/local/java and I have put the 
> JDBC driver in /usr/local/java/jre/lib/ext/ where they recommend to put 
> it. I have also changed my CLASSPATH to the full path to the file 
> (including the .jar file). After compiling and running an applet, it is 
> still complaining to me about MySQL JDBC Driver not being found. I use 
> NetBeans IDE but I run the java program from the command line, (after 
> NetBeans compiles it). I have also mounted the .jar file into the 
> filesystems in NetBeans as an archive. I am still experiencing this 
> problem.

First, you should be aware that a java applet is very different from a
standalone java application.  Applets have much more restrictive
security constraints.  For example, a java applet can only make network
connections to the host from which it was downloaded.  So your database
server and web server have to be the same, or the JDBC driver won't be
able to connect.

Second, you don't have to add jar files in the jre/lib/ext directory to
your CLASSPATH.  This directory is for installed extensions, and any jar
files in this directory will be automatically added to the classpath
when the JVM starts.

Can you post the code that isn't working?
-- 
Jason Day                                       jasonday at
http://jasonday.home.att.net                    worldnet dot att dot net
 
"Of course I'm paranoid, everyone is trying to kill me."
    -- Weyoun-6, Star Trek: Deep Space 9



More information about the Ale mailing list