title: How to determinate hibernate to return sql error
body: <p>I am trying to understand how it is possible to get sql error message from database during failed query through hibernate.</p>
  
  <p>my database has a table like this:</p>
  
  <pre><code> TABLE applications
   (
     id serial NOT NULL,
     name character varying(80) NOT NULL,
     CONSTRAINT applications_pkey PRIMARY KEY (id),
     CONSTRAINT applications_name_key UNIQUE (name)
   )
  </code></pre>
  
  <p>i try two times insert into this table row with same cell name value. Firs query already done, when second is queried i get only message from caught exception:</p>
  
  <pre><code> could not execute statement
  </code></pre>
  
  <p>that is too few, that should help me to find what is wrong? I want get information from database something like </p>
  
  <pre><code>SQL Error. Duplicate column 'name' values
  </code></pre>
  
  <p>Hibernate with HibernateException just cover true cause error. Anyone know how to avoid situation like this?</p>