Skip navigation links

MySQL Forums :: Connector/JDBC and Java :: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure


Advanced Search

Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
Posted by: Lin klinmy ()
Date: July 19, 2008 01:29AM

Hi, I got the same problem last time.

But I kill it!!

Look at my Exception while use jdbc.

///////////////////////////////////////////////////////////////////
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

Last packet sent to the server was 0 ms ago.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2103)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:718)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:46)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:302)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:282)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at com.kag.db.DBConnection.<init>(DBConnection.java:80)
at com.kag.db.DBConnection.getConnection(DBConnection.java:94)
at com.kag.db.DBConnection.main(DBConnection.java:227)
Caused by: java.net.UnknownHostException: host
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:849)
at java.net.InetAddress.getAddressFromNameService(InetAddress.java:1200)
at java.net.InetAddress.getAllByName0(InetAddress.java:1153)
at java.net.InetAddress.getAllByName(InetAddress.java:1083)
at java.net.InetAddress.getAllByName(InetAddress.java:1019)
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:243)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:280)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2026)
... 14 more
2008-7-19 15:10:39 com.kag.db.DBConnection <init>
warning: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

Last packet sent to the server was 0 ms ago.
/////////////////////////////////////////////////////

I set the database name as: "jdbc:mysql://host:3306/test";
Look at the exception message: "Caused by: java.net.UnknownHostException: host".

So, Just change "host to localhost", it works!!!!

There may be something wrong with host or port .
Such as "error host" or "error port"(may be port was used!) !
Change it when needed,it may work!!

Look at the exception ,maybe there is a answer!!

Good Luck!!!!!

Options: ReplyQuote


Subject Written By Posted
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure ma haibo 03/03/2008 09:08PM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure ma haibo 03/04/2008 03:55AM
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure adul adul 02/25/2009 07:17AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Gordon Haywood 03/04/2008 05:54PM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure ma haibo 03/04/2008 07:47PM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsExceptio n: Communications link failure aaaa bbb 07/07/2010 08:33AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Gordon Haywood 03/05/2008 01:56AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure paul d 03/05/2008 08:32AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Peter Wolf 03/20/2008 09:04AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Penny Koroptvatch 03/30/2008 04:29PM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Sultan Tezadov 04/06/2008 12:09AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsExceptio n: Communications link failure Bubba Gump 04/07/2008 09:38PM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsExceptio n: Communications link failure aaaa bbb 07/07/2010 08:33AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Lukasz Kwiatkowski 04/11/2008 01:54AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Lin klinmy 07/19/2008 01:29AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Anurag Patil 08/03/2009 07:11AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure venkataramana challa 03/04/2009 12:40AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Andrew Sargison 03/10/2009 04:09PM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsExceptio n: Communications link failure Andrew Sargison 03/12/2009 05:11AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure S KR 05/06/2009 12:30AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Anurag Patil 08/03/2009 07:09AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Ar 3,14 09/18/2009 10:48AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsExceptio n: Communications link failure Prasanna Pilla 11/14/2009 12:07PM
com.mysql.jdbc.exceptions.MySQLSyntaxErrorException Abu Jafar 11/17/2009 11:09PM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure aaaa bbb 07/07/2010 08:43AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Uros Djokic 12/03/2009 09:16AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Peter Sun 01/15/2010 08:17PM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsExceptio n: Communications link failure Felix Glez 02/09/2010 03:16AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsExceptio n: Communications link failure Joan Manuel 08/23/2010 11:58AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Jonathan Stuart 03/16/2010 05:13AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Andreas T. 04/26/2010 07:39AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsExceptio n: Communications link failure James Peters 05/22/2010 09:12PM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsExcept ion: Communications link failure myriam leggieri 06/16/2010 03:43AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsExce ption: Communications link failure myriam leggieri 06/16/2010 08:24AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure aaaa bbb 07/07/2010 08:32AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Double Dragon 06/02/2010 06:01AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure jack fergussen 07/08/2010 08:14AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure V C 10/06/2010 08:34AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.