Salut j'essaye de connecter Java a mysql mais j'ai une erreur que j'arrive pas a réglé veuillez m'aider svp, voici mon code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| try {
Class.forName("com.mysql.jdbc.Driver");
System.out.println("DRIVER OK ! " );
String url = "jdbc:mysql://localhost:5432/test";
System.out.println("DRIVER OK ! " );
String user = "root";
String passwd = "";
System.out.println("DRIVER OK ! " );
Connection conn = DriverManager.getConnection(url, user, passwd );
System.out.println("Connection effective !");
Statement state = conn.createStatement();
}catch (Exception e){
e.printStackTrace();
} |
l'erreur est a ce niveau
Connection conn = DriverManager.getConnection(url, user, passwd );
voici le type d'erreur
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
Partager