title: JDBC connection with auto reconnect
body: <p>I am using JDBC to connect to a database server.
  The connection is over a wireless network and can be dodgy at times.
  At the moment when the connection is lost I need to close and restart the application.</p>
  
  <p>Does anyone have some examples of code where I could write some sort of wrapper to automatically reconnect and rerun the last query? This would save a lot of hassles.</p>
  
  <p>I am just not sure how it should/could be implemented.
  Maybe there is already something available?</p>