This might be a firewall issue, it could be blocking incoming connections on the MySQL port (by default, 3306). To see if that's the case, you could try telnetting into the MySQL server and port and seeing if you're denied access.
Here's a Sun forums post which discusses this error.
Kaleb Brasee
2009-11-15 23:30:56