Results 1 to 5 of 5
  1. #1
    Heather is offline Senior Member
    Join Date
    Jun 2007
    Posts
    164
    Rep Power
    8

    Default ClassNotFoundException com.mysql.jdbc.Driver

    Hi guys, I have a problem when I try to locate for example my mysql connector.
    In my class to load the controller the sentence is:
    Java Code:
    static final String CONTROL_JDBC = "com.mysql.jdbc.Driver ";
    But an exception appears:
    Java Code:
    java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
            at java.net.URLClassLoader$1.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at java.lang.ClassLoader.loadClassInternal(Unknown Source)
            at java.lang.Class.forName0(Native Method)
            at java.lang.Class.forName(Unknown Source)
            at org.db.LoadDB.LoadController(LoadDB.java:19)
    thank you
    Last edited by Heather; 06-30-2007 at 02:39 PM.

  2. #2
    Peter is offline Senior Member
    Join Date
    Jun 2007
    Posts
    119
    Rep Power
    0

    Default

    Why don't you use netbeans as IDE?, it has a menu where you create your project and add .jar of your controller.
    ;)

  3. #3
    Jack is offline Senior Member
    Join Date
    Jun 2007
    Posts
    130
    Rep Power
    0

    Default

    you must copy the mysql-connector jar file into this two directories:
    Java Code:
    < your dir >\jre\lib\
    < yourdir >\jre\lib\ext\
    If you are using netbeans like your default IDE, restart it after copying this files.

  4. #4
    Ashutosh is offline Member
    Join Date
    Mar 2010
    Posts
    1
    Rep Power
    0

    Thumbs up JDBC Connector Error

    Just extract the jar file. You'll be getting a com folder. Just paste that folder in the bin folder of jdk.

    Done...enjoy!! \m/

  5. #5
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default

    1. This is nearly 3 years old.
    2. This is a very bad suggestion...the bin folder is not for dumping any old stuff in. Not that the suggestion od sticking it in the JRE lib is any better.

Similar Threads

  1. Replies: 6
    Last Post: 02-19-2010, 01:57 PM
  2. Replies: 0
    Last Post: 03-21-2008, 01:13 PM
  3. can't register a MySQL driver
    By prfalco in forum New To Java
    Replies: 4
    Last Post: 02-03-2008, 11:13 PM
  4. mysql driver problem
    By mokingsu in forum JDBC
    Replies: 4
    Last Post: 01-17-2008, 05:27 PM
  5. Replies: 1
    Last Post: 06-27-2007, 05:57 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •