title: Why is my JDBC update not working?
body: <p>I've been migrating from PostgreSQL 9.1 to Oracle 11gR2 and have run into an odd issue. </p>
  
  <p>I've been running code that updates a table when a customer has been added to our ERP system. This code has been running on PostgreSQL with no issues since March. Now that I'm switching to  Oracle the same code is no longer updating.</p>
  
  <p><strong>Original Code</strong></p>
  
  <pre><code>update = "UPDATE store SET added_customer = 'y' WHERE order_id = ?";
  try {
      PreparedStatement pStmnt = getConn().prepareStatement(update);
      pStmnt.setString(1, orderId);               
      results = pStmnt.executeUpdate();
  
      if (results &gt; 0) {
          added = true;                   
      }       
  } catch (SQLException ex) {
      LOGGER.error(ex.toString());
  }
  </code></pre>
  
  <p>No exceptions were thrown, but no data changed so I thought "autocommit must not be working, lets commit manually":</p>
  
  <p><strong>New Code</strong></p>
  
  <pre><code>update = "UPDATE shop_ca_orders SET added_customer = 'y' WHERE order_id = ?";
  try {                 
      getConn().setAutoCommit(false); //Added
      PreparedStatement pStmnt = getConn().prepareStatement(update);
      pStmnt.setString(1, orderId);               
      results = pStmnt.executeUpdate();
  
      if (results &gt; 0) {
          added = true;
          getConn().commit(); //Added
          getConn().setAutoCommit(true); //Added
      }       
  } catch (SQLException ex) {
      LOGGER.error(ex.toString());
  }
  </code></pre>
  
  <p>Still no luck so I added <code>LOGGER.debug("Update to order returned {}",results);</code> after the <code>executeUpdate</code> statement and found I am returning 0, so no records are being updated. </p>
  
  <p>Interesting, so I tried the query via SQL Developer and it updated correctly.  This brings me to my question: </p>
  
  <p><strong>Why am I unable to update my database via JDBC?</strong></p>
  
  <p><strong>Essential Data:</strong></p>
  
  <ul>
  <li><code>order_id</code> is type <code>VARCHAR(255 BYTE)</code>.  </li>
  <li>Java 7  </li>
  <li>Oracle 11GR2 running on Amazons RDS  </li>
  <li>Migrated from PostgreSQL 9.1 running on Heroku </li>
  <li>On PostgreSQL <code>order_id</code> is a <code>character varying(255)</code></li>
  </ul>
  
  <p><strong>EDIT</strong></p>
  
  <p>A small schema change was undetected and resulted in a bug where the order ID was actually the name of the person, and not the order ID. Bonehead error on my end. Anyways, now that I have that resolved and pulling the correct order ID I have found that I am hanging on <code>executeUpdate</code>. Currently working on that issue. I'll likely create a new question if I am unable to resolve. </p>