title: Servlet catch unique constraint exception
body: <p>I'm trying to insert some data into the table named <code>rmas</code>.</p>
  
  <p>The table format is</p>
  
  <pre><code>|rcode|rname|vcode|vanme
  </code></pre>
  
  <p>Here, I set primary key for rcode.</p>
  
  <p>When I'm inserting a record with existing rcode, it displays something like <strong>ORA-0000-1 unique constraint Violated</strong>..</p>
  
  <p>If I'm using the following code, it displays the message even in the case of other errors.</p>
  
  <pre><code>catch(Exception e)
  {
   //out.println("rcode already exists");
  }
  </code></pre>
  
  <p>So, I want to catch that primary key exception only and display as "rcode already exist". Is it possible? If yes, then how?</p>
  
  <p>Thanks in advance</p>