Utilizzo macOS Catalina e come ide utilizzo Eclipse, abbiamo iniziato a creare progetti per interagire con database MySQL.
Ho scaricato il driver per la connessione e l'ho incluso tra i driver di Eclipse però quando vado a lanciare il programma mi dà questo errore. Vi allego il codice e lo screen del driver incluso.
Spero possiate aiutarmi, grazie!
import java.sql.*;
public class connessioneDB {
	public static void main(String[] args) throws SQLException {
		Connection cn = null;
		Statement stm;
		ResultSet res = null;
		String sql;
		try {
			Class.forName("com.mysql.jdbc.Driver");
		}catch(ClassNotFoundException e) {
			System.out.println("ClassNotFoundException: ");
			System.err.println(e.getMessage());
		}
		
		try {
			cn = DriverManager.getConnection("jdbc:mysql:/localhost:3306/prova", "root", "");
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		sql = "select * from alunni";
		
		try {
			stm = cn.createStatement();
			res = stm.executeQuery(sql);
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		while(res.next() == true)
			System.out.println(res.getString("nome")+" "+res.getString("cognome"));
		cn.close();
	}
}