title: conditional statements in derby
body: <p>It looks like <a href="http://db.apache.org/derby/manuals/index.html#docs_10.5" rel="noreferrer">derby</a> doesn't support conditional statements [IF]. How do we write </p>
  
  <pre><code>if exists (select 1 from customers where name='somename') 
      update customers ...
  else 
      insert into customers ...
  </code></pre>
  
  <p>in derby? Derby doesn't have 'replace into' of mysql either.</p>
  
  <p>Note: I am using derby as unit-testing replacement for mysql [that is production will use mysql and unit-test will use derby].</p>