0

I'm working on a statistics project(java code, on eclipse,windows server 2008) that handles big amount of data,i generate reports using crystal reports 2011, but in the viewer , sometimes when the data > 7 Gb , the report displayed blank page and i got this error

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

i thought that it's a memory problem,i tried to increase the memory pool in apache tomcat but it didn't solve the problem , if any one have a solution for this problem i'll be grateful, Thanks in advance

user174
  • 65
  • 2
  • 10
  • 1
    http://stackoverflow.com/questions/2983248/com-mysql-jdbc-exceptions-jdbc4-communicationsexception-communications-link-fai – Ninad Pingale May 22 '15 at 06:04
  • [You can try these steps mentioned in a similar post.](http://stackoverflow.com/questions/2983248/com-mysql-jdbc-exceptions-jdbc4-communicationsexception-communications-link-fai) – Gaurav Mahawar May 22 '15 at 06:40

2 Answers2

0

edit the file:

$ sudo vi /etc/mysql/hosts.allow

And add a line:

mysqld : 127.0.0.1 : allow

This solves the cmmunications link failure problem

  • if you are using an IDE to develop your system you should be able to set the classpath with that.
  • if you set the classpath in the terminal using the export command it will only set the variable for that single session, open a second terminal and your program won't run there!

OTHER CHECK POINTS

changing "bind-address" attribute

Uncomment "bind-address" attribute or change it to one of the following IPs:

bind-address="127.0.0.1"

or

bind-address="0.0.0.0"

commenting out "skip-networking"

If there is a "skip-networking" line in your MySQL config file, make it comment by adding "#" sign at the beginning of that line.

change "wait_timeout" and "interactive_timeout"

Add these lines to the MySQL config file:

wait_timeout = number

interactive_timeout = number

connect_timeout = number

check Operating System proxy settings

Make sure the Fire wall, or Anti virus soft wares don't block MySQL service.

BhandariS
  • 606
  • 8
  • 20
0

It's a database connection problem. Your application could not connect to a MySQL database using a jdbc connection. I suggest you check your database connection settings, and your MySQL server.

What you can do:

Try connecting from another client, like MySQL Workbench or alikes. Use the same credentials. If you can't connect from there the problem is either:

  • The database server is down
  • Your credentials are wrong

Another possibility is

  • Your application is timing out.

You say this happens when you work with big amounts of data, so this would explain it. What you can do in this case is set a higher timeout both in your application and in the database server.

FSS
  • 1
  • 3