Nie mogę połączyc sie z baza, wyskakuje błąd.
Kod wygląda tak:
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
c=DriverManager.getConnection("jdbc:mysql://TuJestIP/NazwaBazy","TuJestLogin", "ATutajHasło");
System.out.println ("Udało się połączyć z bazą danych...");
} catch (ClassNotFoundException e) {
System.out.println(e.getMessage());
System.out.println(e.getMessage());
} catch (Exception e) {
System.out.println(e.getMessage());
}
Konslowa wygląda tak:
Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
BUILD SUCCESSFUL (total time: 2 seconds)
Sterownik mam tu:
D:\Program Files\Java\jdk1.7.0_07\jre\lib\ext
Ktoś wie gdzie leży błąd ?