title: Java Executor Service - Multiple Threads - Insert If not Exists Mysql
body: <p>I have 10 threads in my thread pool and am executing a task depending upon its entry in the mysql. The problem is that if the entry exists in the mysql database there is no need for processing and the control will return from there. </p>
  
  <p>I have used unique constraint in the table but how can I handle it in the application level?</p>
  
  <p>Other than catcin<code>sqlintegrityconstraintviolationexception</code> is there any way out? </p>