Connection java avec bd mysql

shumi5 Messages postés 2 Date d'inscription mercredi 23 mars 2005 Statut Membre Dernière intervention 29 mars 2005 - 23 mars 2005 à 23:40
bloofi Messages postés 388 Date d'inscription mercredi 1 octobre 2003 Statut Membre Dernière intervention 3 mai 2006 - 24 mars 2005 à 11:51
Bonjour à tous,
je suis en 4éme année école d'ing.
je travaille sur le deboggage d'un projet (java,bd mysql).L'application java est déjà faite.

L'application java est censée créer une bd et se connecter à cette base.
Mais en lançant cette application il me dit que la communication entre java et la bd mysql a échoué et il m'affiche ce message:


SQLException: Communications link failure due to underlying exception:


** BEGIN NESTED EXCEPTION **


java.net.UnknownHostException


MESSAGE: null: null


STACKTRACE:


java.net.UnknownHostException: null: null


at java.net.InetAddress.getAllByName0(Unknown Source)


at java.net.InetAddress.getAllByName0(Unknown Source)


at java.net.InetAddress.getAllByName(Unknown Source)


at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:133)


at com.mysql.jdbc.MysqlIO.(MysqlIO.java:280)


at com.mysql.jdbc.Connection.createNewIO(Connection.java:1765)


at com.mysql.jdbc.Connection.(Connection.java:430)


at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:268)


at java.sql.DriverManager.getConnection(Unknown Source)


at java.sql.DriverManager.getConnection(Unknown Source)


at horsligne.util.BDmysql.creerBD(BDmysql.java:36)


at horsligne.util.BDGenerale.(BDGenerale.java:25)


at horsligne.ui.NouveauProjetUi.actionPerformed(NouveauProjetUi.java:209)


at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)


at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)


at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)


at javax.swing.DefaultButtonModel.setPressed(Unknown Source)


at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)


at java.awt.Component.processMouseEvent(Unknown Source)


at javax.swing.JComponent.processMouseEvent(Unknown Source)


at java.awt.Component.processEvent(Unknown Source)


at java.awt.Container.processEvent(Unknown Source)


at java.awt.Component.dispatchEventImpl(Unknown Source)


at java.awt.Container.dispatchEventImpl(Unknown Source)


at java.awt.Component.dispatchEvent(Unknown Source)


at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)


at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)


at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)


at java.awt.Container.dispatchEventImpl(Unknown Source)


at java.awt.Window.dispatchEventImpl(Unknown Source)


at java.awt.Component.dispatchEvent(Unknown Source)


at java.awt.EventQueue.dispatchEvent(Unknown Source)


at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)


at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)


at java.awt.EventDispatchThread.pumpEvents(Unknown Source)


at java.awt.EventDispatchThread.pumpEvents(Unknown Source)


at java.awt.EventDispatchThread.run(Unknown Source)





** END NESTED EXCEPTION **





SQLState: 08S01


VendorError: 0


SQLException: Communications link failure due to underlying exception:


** BEGIN NESTED EXCEPTION **


java.net.UnknownHostException


MESSAGE: null


STACKTRACE:


java.net.UnknownHostException: null


at java.net.InetAddress.getAllByName0(Unknown Source)


at java.net.InetAddress.getAllByName0(Unknown Source)


at java.net.InetAddress.getAllByName(Unknown Source)


at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:133)


at com.mysql.jdbc.MysqlIO.(MysqlIO.java:280)


at com.mysql.jdbc.Connection.createNewIO(Connection.java:1765)


at com.mysql.jdbc.Connection.(Connection.java:430)


at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:268)


at java.sql.DriverManager.getConnection(Unknown Source)


at java.sql.DriverManager.getConnection(Unknown Source)


at horsligne.util.BDmysql.connecterBD(BDmysql.java:62)


at horsligne.util.BDGenerale.(BDGenerale.java:26)


at horsligne.ui.NouveauProjetUi.actionPerformed(NouveauProjetUi.java:209)


at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)


at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)


at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)


at javax.swing.DefaultButtonModel.setPressed(Unknown Source)


at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)


at java.awt.Component.processMouseEvent(Unknown Source)


at javax.swing.JComponent.processMouseEvent(Unknown Source)


at java.awt.Component.processEvent(Unknown Source)


at java.awt.Container.processEvent(Unknown Source)


at java.awt.Component.dispatchEventImpl(Unknown Source)


at java.awt.Container.dispatchEventImpl(Unknown Source)


at java.awt.Component.dispatchEvent(Unknown Source)


at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)


at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)


at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)


at java.awt.Container.dispatchEventImpl(Unknown Source)


at java.awt.Window.dispatchEventImpl(Unknown Source)


at java.awt.Component.dispatchEvent(Unknown Source)


at java.awt.EventQueue.dispatchEvent(Unknown Source)


at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)


at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)


at java.awt.EventDispatchThread.pumpEvents(Unknown Source)


at java.awt.EventDispatchThread.pumpEvents(Unknown Source)


at java.awt.EventDispatchThread.run(Unknown Source)





** END NESTED EXCEPTION **





SQLState: 08S01


VendorError: 0


Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException


at horsligne.util.BDmysql.creerTable(BDmysql.java:79)


at horsligne.util.BDGenerale.(BDGenerale.java:27)


at horsligne.ui.NouveauProjetUi.actionPerformed(NouveauProjetUi.java:209)


at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)


at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)


at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)


at javax.swing.DefaultButtonModel.setPressed(Unknown Source)


at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)


at java.awt.Component.processMouseEvent(Unknown Source)


at javax.swing.JComponent.processMouseEvent(Unknown Source)


at java.awt.Component.processEvent(Unknown Source)


at java.awt.Container.processEvent(Unknown Source)


at java.awt.Component.dispatchEventImpl(Unknown Source)


at java.awt.Container.dispatchEventImpl(Unknown Source)


at java.awt.Component.dispatchEvent(Unknown Source)


at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)


at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)


at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)


at java.awt.Container.dispatchEventImpl(Unknown Source)


at java.awt.Window.dispatchEventImpl(Unknown Source)


at java.awt.Component.dispatchEvent(Unknown Source)


at java.awt.EventQueue.dispatchEvent(Unknown Source)


at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)


at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)


at java.awt.EventDispatchThread.pumpEvents(Unknown Source)


at java.awt.EventDispatchThread.pumpEvents(Unknown Source)


at java.awt.EventDispatchThread.run(Unknown Source)

PS: Hors ligne c'est le nom du projet.
L'application a été compilé l'année dernière et tout marchait bien alors le pb ne doit pas etre un pb de programmation.
A votre avis c'est koi la solution de ce pb.
Je vous remercie.
C'est urgent.
Merci d'avance.

1 réponse

bloofi Messages postés 388 Date d'inscription mercredi 1 octobre 2003 Statut Membre Dernière intervention 3 mai 2006 2
24 mars 2005 à 11:51
java.net.UnknownHostException...

lé ptet la le problème non ?
0
Rejoignez-nous