I am having a problem with a connection object timing out in a servlet. The connection is created in a servlets init() method and is used indefinitely in synchonized methods throughout the servlet while the web application runs. This worked ok with microsoft sql, but now using mySql the connection times out and then creates SQLExceptions.
Does anyone know how best to fix this? Should I catch each sql exception and test for the connection being null and if it is create a new one? (Seems a bit long-winded). Or is there a Better Way?
Many thanks
Does anyone know how best to fix this? Should I catch each sql exception and test for the connection being null and if it is create a new one? (Seems a bit long-winded). Or is there a Better Way?
Many thanks