Newsletters older than 6 months may have links that are out of date. Please use the Search to check for updated links.
I have a servlet/application that works fine for a day, and then stops working overnight? What can I do?
MySQL closes connections after 8 hours of inactivity. You either need to use a connection pool that handles stale connections or use the "autoReconnect" parameter (see "Developing Applications with MySQL Connector/J").
Also, you should be catching SQLExceptions in your application and dealing with them, rather than propagating them all the way until your application exits. This is just good programming practice. MySQL Connector/J will set the SQLState to "08S01" when it encounters network-connectivity issues during the processing of a query. Your application code should then attempt to re-connect to MySQL at this point.
Other relevant information can be found in the MySQL documentation at
http://www.mysql.com/documentation/connector-j/index.html#id2802490 (http://www.mysql.com/documentation/connector-j/index.html#id2802490)