Basically, I created a Connection con variable and initialised it correctly. The connection and the query and all operation from my Java code to the MySQL Database works perfect. The problem is that if after exactly one minute if the user didn't interact with program, and then I preformed any operation with database (Using the Java program) it shows the following error.
Communications link failure
The last packet successfully received from the server was 139,417 milliseconds ago. The last packet sent successfully to the server was 0 milliseconds ago.
and after I press ok on the message dialog this comes up:
No operation allowed after connection closed.
I already checked the connection timeout using
System.out.println(con.getNetworkTimeout());
it showed me "0", which from a basic online reading it should be unlimited, I guess.
I want to extend it from disconnecting after 1 minute to 3 or 4 minutes.