File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes MySql Database connectivity problem - Communications link failure Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "MySql Database connectivity problem - Communications link failure" Watch "MySql Database connectivity problem - Communications link failure" New topic
Author

MySql Database connectivity problem - Communications link failure

Astha Sharma
Ranch Hand

Joined: Oct 15, 2011
Posts: 245

Hi,

I am having problem in connecting my web services with database. This is my code fro connection-

It gives the following error-

But when I connect with database at localhost, it works fine with no such error.
I have checked many links but not getting any specific solution. Please help.


Astha - OCPJP 6 (90%)
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1454
    
    6

Can you ping the specified ip? If ping works try to telnet the ip on the specific port and see the response.


Swastik
Astha Sharma
Ranch Hand

Joined: Oct 15, 2011
Posts: 245

I added a new user in database. In place of root user I created connection string with new username and password and now it works fine
Thanks for the help
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: MySql Database connectivity problem - Communications link failure