title: Interrupt a thread performing a long running database select
body: <p>My requirement is quite similar to <a href="https://stackoverflow.com/questions/1024482/stop-interrupt-threads-blocked-on-wainting-input-from-socket">this</a> one except that my long running IO operation is a database select. </p>
  
  <p>One rather rather creative solution suggested in that thread, involved closing the IO stream in a separate thread. However, I don't really have a reference to the input stream or socket. </p>
  
  <p>I can't even close the connection being used as I use spring-jdbc, which does not provide me access to the underlying connection being used. I believe <code>JdbcTemplate.getDataSource().getConnection()</code> will potentially return another connection from the data source. </p>
  
  <p>Appreciate any help/suggestions i can get.</p>