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.
David