Results 1 to 3 of 3

Thread: ClassNotFound

  1. #1
    cucucur is offline Member
    Join Date
    Apr 2011
    Posts
    20
    Rep Power
    0

    Default ClassNotFound

    hello! I'm trying to set up my database with java, and this code:

    Java Code:
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    Throws this exception:

    Java Code:
    java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    I'm quite sure the driver works, so I can't understand!

    Thank you in advance

  2. #2
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    Add the jar file that contains the driver to the classpath when you run the program.

  3. #3
    cucucur is offline Member
    Join Date
    Apr 2011
    Posts
    20
    Rep Power
    0

    Default

    thank you! how can I do it? (I work with ubuntu), and I'm using php-java bridge, without it it works! I can't undestand!!

Similar Threads

  1. classnotfound exception in jdbc
    By tariq9112003 in forum Advanced Java
    Replies: 5
    Last Post: 06-07-2011, 10:47 AM
  2. ClassNotFound exception
    By aldm in forum New To Java
    Replies: 3
    Last Post: 10-08-2010, 10:15 AM
  3. MySqlProblem ClassNotFound
    By Burglar_Cat in forum JDBC
    Replies: 3
    Last Post: 05-13-2010, 10:31 AM
  4. ClassNotFound exception for inner class
    By hirop35 in forum New To Java
    Replies: 0
    Last Post: 11-30-2009, 05:25 AM
  5. classnotfound
    By mirror666 in forum New To Java
    Replies: 1
    Last Post: 11-11-2008, 02:54 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
  •