0

I haven't even started with the program but the Class.forName() is giving an error for mysql, as can be seen in the screenshot. The error is java.lang.ClassnotFoundException, even though I included external jar file I am pretty sure I am missing something trivial, all answers on internet tell me to include jar file but I dont know where I am wrong.Folder structure

My Code, please ignore other errors its not even started yet

  • 1
    Don't post code as a screenshot. Also using `Class.forName` hasn't been necessary to load a JDBC driver since 2006. I have voted to close with the canonical duplicate, but as your post lacks a clear indication of the full error, the problem could just as well be that you **forgot to catch + handle or declare the `ClassNotFoundException`**. – Mark Rotteveel Feb 05 '17 at 12:03
  • 1
    Thank you it was the try block error, But I was going to add catch statement later AND there was a separate error for try block, so I thought these were different errors Anyway catch statement solved my problem thanks If this thread needs to be deleted then I am ok with it – Ashish Kumar Feb 05 '17 at 12:11

0 Answers0