Meaningless Drivel is fun!
The moose likes Java in General and the fly likes MYSql Driver ClassNotFound Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "MYSql Driver ClassNotFound Exception" Watch "MYSql Driver ClassNotFound Exception" New topic

MYSql Driver ClassNotFound Exception

Karthik Krishnamurthy
Ranch Hand

Joined: Feb 04, 2005
Posts: 118
I am running a web based application using applets.
The applet has to connect to an underlying MYSql database.
I have used DriverManager.getConenction()....

When I run it on my machine as a standalone (in my Netbeans IDE) it runs fine.

I then "jar"ed and loaded the applet on the server in root/htd/lib directory and placed the mysql connector also in the same directory.
But I am getting ClassNotFound Exception

The applet runs fine if I hard code the value I need from the database.

Pl. help

Chengwei Lee
Ranch Hand

Joined: Apr 02, 2004
Posts: 884
Is your JDBC library Jar in your classpath?

SCJP 1.4 * SCWCD 1.4 * SCBCD 1.3 * SCJA 1.0 * TOGAF 8
Karthik Krishnamurthy
Ranch Hand

Joined: Feb 04, 2005
Posts: 118
I added the mysql driver to the path but now I am getting the following AccessControlException :

Unable to connect to any hosts due to exception: access denied ( connect,resolve)**
BEGIN NESTED EXCEPTION ** access denied ( connect,resolve) access denied ( connect,resolve)at Source)at Source)at java.lang.SecurityManager.checkPermission(Unknown Source)at java.lang.SecurityManager.checkConnect(Unknown Source)at Source)at Source)at<init>(Unknown Source)at<init>(Unknown Source)at com.mysql.jdbc.StandardSocketFactory.connect( com.mysql.jdbc.MysqlIO.<init>( com.mysql.jdbc.Connection.createNewIO( com.mysql.jdbc.Connection.<init>( com.mysql.jdbc.NonRegisteringDriver.connect( java.sql.DriverManager.getConnection(Unknown Source)at java.sql.DriverManager.getConnection(Unknown Source)at vdt.VdtModuleApplet.getConnection( vdt.VdtModuleApplet.init( Source)at Source)** END NESTED EXCEPTION ** System = Inited, gotParameters, init propertiesGetting Connection
I agree. Here's the link:
subject: MYSql Driver ClassNotFound Exception
It's not a secret anymore!