-
Timeout avec mysql
Bonjour,
Dans mon applet, j'utilise ce code pour me connecter à ma database :
Class.forName("com.mysql.jdbc.Driver");
String DBurl = "jdbc:mysql://IPSERVEUR:3306/ns3";
m_connection = DriverManager.getConnection(DBurl,"pass","");
Cela fonctionne si je demarre l'applet directement depuis mon serveur mais depuis un pc distant, j'ai une erreur timeout :
com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.net.ConnectException
MESSAGE: Connection timed out: connect
STACKTRACE:
java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:256)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:271)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2744)
at com.mysql.jdbc.Connection.<init>(Connection.java:1553)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at ConnexionMdb.ouvrirConnexion(ConnexionMdb.java:16)
at ConnexionMdb.executeRequeteSelect(ConnexionMdb.java:101)
at ParamDao.get(ParamDao.java:19)
at TestConnexion.init(TestConnexion.java:30)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
** END NESTED EXCEPTION **
Last packet sent to the server was 0 ms ago.
Si quelqu'un peut m'aider à résoudre ce problème, merci d'avance
-
D'après l'erreur il ne peut pas de connecté ... je soupsonne un firewall qui bloque.
dans une console ( dos ou shell ) :
Code:
1 2
|
telnet IPDUSERVEUR 3306 |
Qu'est-ce que ca renvoie ?
-
timeout
Voila ce que retourne la commande :
"A
5.0.41-community-nt?[,gE`6)k,?b*Fa6)gN1Jb,
Perte de la connexion à l'hôte."
Ca risque de confirmer la thèse du firewall ...
Je me penche la dessus, merci Hikage