title: COMMIT OR conn.setAutoCommit(true)
body: <p>I have noticed some programmer using <code>COMMIT</code> other using <code>conn.setAutoCommit(true);</code> to end the transaction or roll back so what are the benefits of using one instead of the other?</p>
  
  <p>Where is the main difference?</p>
  
  <pre><code>conn.setAutoCommit(true);
  </code></pre>
  
  <p>over</p>
  
  <pre><code>statement.executeQuery(query);
  statement.commit();
  </code></pre>