java.lang.ClassNotFoundException: com.mysql.jdbc.Driver in Eclipse

前端 未结 18 2211
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-22 15:41

What is wrong with the code there are lots of error while debugging. I am writing a code for a singleton class to connect with the database mysql.

Here is my code

18条回答
  •  佛祖请我去吃肉
    2020-11-22 16:13

    The exception can also occur because of the class path not being defined.

    After hours of research and literally going through hundreds of pages, the problem was that the class path of the library was not defined.

    Set the class path as follows in your windows machine

    set classpath=path\to\your\jdbc\jar\file;.
    

提交回复
热议问题