title: jOOQ: DataAccessException and constraints
body: <p>I am implementing a REST API with Jersey and jOOQ.</p>
  
  <p>I have a table with some constraints, for example a unique key. When inserting a tuple which violates this constraint, jOOQ throws a <code>DataAccessException</code>:</p>
  
  <pre><code>org.jooq.exception.DataAccessException: SQL [insert into ...]; ERROR: duplicate key value violates unique constraint "issue_name_key"
  </code></pre>
  
  <p>Is there a way to find out which constraint has been violated, without string-parsing the error message? If a constraint is violated, I want to return a <code>400 bad request</code> http status code instead of a <code>500 general error</code>.</p>
  
  <p>If this is not possible, what is common practise here? Should I query the database for each possible constraint violation? This smells like a maintenance trap.</p>