0

So I've been trying to connect this simple database to this java tax program I am working on for school and I can't get the SQL database to connect no matter what I do (using Eclipse IDE). I have the connector installed (mysql-connector-java-8.0.18), but I am still getting the jdbc.Driver ClassNotFound Exception. Anyone have any ideas?

            Class.forName("com.mysql.jdbc.Driver");
            // create mysql connection 
            Connection connection=DriverManager.getConnection("jdbc:mysql://localhost:3306//PersonDB","root","rootroot");  
            Statement statement=connection.createStatement();

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

Any tips?

Harry Coder
  • 2,429
  • 2
  • 28
  • 32
jkorn95
  • 45
  • 6

1 Answers1

0

Add the jar library manually to the project.

Right Click the project -- > build path -- > configure build path

In Libraries Tab press Add External Jar and Select your jar.

You can find zip for mysql-connector here