A voir également:
- {MySQL} connexion via jdbc de java
- Gmail connexion - Guide
- Waptrick java football - Télécharger - Jeux vidéo
- Jeux java itel football - Télécharger - Jeux vidéo
- Hotmail connexion - Guide
- Waptrick jeux java itel ✓ - Forum Mobile
1 réponse
mon erreur a changé, voici mon nouveau code :
et ma nouvelle erreur!
Exception in thread "main" com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.net.SocketException
MESSAGE: java.net.ConnectException: Connection timed out: connect
STACKTRACE:
java.net.SocketException: java.net.ConnectException: Connection timed out: connect
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:151)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:280)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:1765)
at com.mysql.jdbc.Connection.<init>(Connection.java:430)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:268)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at bdgl_projet.Main.main(Main.java:28)
** END NESTED EXCEPTION **
at com.mysql.jdbc.Connection.createNewIO(Connection.java:1830)
at com.mysql.jdbc.Connection.<init>(Connection.java:430)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:268)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at bdgl_projet.Main.main(Main.java:28)
Java Result: 1
Class.forName("com.mysql.jdbc.Driver"); String bdUrl = "jdbc:mysql://10.0.5.165:3306/jdbc:i6243719:bd"; String user = "i6243719"; String mdp = "ab3xx1hcauvc58e9"; Connection c = DriverManager.getConnection(bdUrl, user, mdp); Statement s = c.createStatement(); // code SQL: ResultSet r = s.executeQuery( "SELECT id,nom " + "FROM Unite "); while(r.next()) { // minuscules et majuscules n'ont // aucune importance: System.out.println( r.getString("id") + ", " + r.getString("nom")); } s.close(); // fermer également ResultSet }
et ma nouvelle erreur!
Exception in thread "main" com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.net.SocketException
MESSAGE: java.net.ConnectException: Connection timed out: connect
STACKTRACE:
java.net.SocketException: java.net.ConnectException: Connection timed out: connect
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:151)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:280)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:1765)
at com.mysql.jdbc.Connection.<init>(Connection.java:430)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:268)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at bdgl_projet.Main.main(Main.java:28)
** END NESTED EXCEPTION **
at com.mysql.jdbc.Connection.createNewIO(Connection.java:1830)
at com.mysql.jdbc.Connection.<init>(Connection.java:430)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:268)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at bdgl_projet.Main.main(Main.java:28)
Java Result: 1