This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 1449
    
    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
 
Similar Threads
Jersey Hibernate Problem
Removing Eclipse Ganymede
JDBC connection
Problem with connecting to database
MySql in not accessing remotely