title: How to set query timeout on PreparedStatement?
body: <p>Is there a way to get Connection.prepareStatement() to throw an error or return, instead of waiting for a row lock?</p>
  
  <p>I am trying to implement cross-process synchronization with using a prepared statement, that i do not commit, so it grabs a write lock on a specific row.  In the other processes it tries to prepare the sql statement, then it hangs while the original process finishes up.  I need this to let me know it is hanging, so i can stop the function, and try again whenever it gets rescheduled.</p>
  
  <p>Any ideas? Ive been googling for days, and can't seem to find a yes/no to this. </p>