i am using netbeans 8.2 and mysql 8.0 and inport mysql connector 8.0.11 to the library file as well for my following java codes,
package jdbc;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;
public class JDBC {
public static void main(String[] args) {
String SQL="Insert into Customer Values('C111','Somadasa','Matugama',34000)";
Class.forName("com.mysql.jdbc.Driver");
Connection connection=DriverManager.getConnection("jdbc:mysql://localhost:3308/ThogaKade", "root", "ftwxy");
Statement stm=connection.createStatement();
stm.executeUpdate(SQL);
}
}
but following lines have been highlighted
Class.forName("com.mysql.jdbc.Driver");
Connection connection=DriverManager.getConnection("jdbc:mysql://localhost:3308/ThogaKade", "root", "mysql");
with the message 'unreported exception ClassNotFoundException; must be caught or declared to be thrown ----' how could fix this problem?