Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes JDBC and Relational Databases and the fly likes mysql connection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "mysql connection" Watch "mysql connection" New topic

mysql connection

Candy Bortniker
Ranch Hand

Joined: Mar 17, 2003
Posts: 123
I'm back to square one again. I had mysql running and working great last night. Now whenever I try to run my program I get an error message:
java.sql.SQLException: Communication link failure:, underlying cause: Unexpected end of input stream
Do I have something set up wrong? Could this be caused from the firewall protection that keeps popping up?
David DeCesare

Joined: May 25, 2001
Posts: 13
Did you leave the connection open all night? MySQL can be configured to drop connections that have been idle for a defined period of time. I believe the default time is 8 hours of inactivity (connections that are idle for 8 hours get dropped). Try reconnecting to the database to see if that fixes your problem.
It test this condition in your code, you could run the .isClosed() method on your Connection object.
Candy Bortniker
Ranch Hand

Joined: Mar 17, 2003
Posts: 123
I tried the .isClosed() but got the same error. I think mysql has has been connected since I got it started on Saturday. Every day when I try it even before I start mysql I get the same error. I think if mysql was disconnected I would be getting the other error that I was getting before Saturday. I have closed it using the X button and have looked for ways to shut it down to start over but haven't found anything.
I agree. Here's the link:
subject: mysql connection
It's not a secret anymore!