title: Make sure Oracle insert statement in order
body: <p>I have an ArrayList let's say with 4 rows in defined order. I want to insert these 4 rows into Oracle table accordingly. But weird, it gets into the table but with wrong order.</p>
  
  <pre><code>for (int x = 0; x &lt; myArray.size(); x++) {
     //Some validation
     //insert statement
     MyJB myJB = (MyJB) myArray.get(x);
     String query = "insert into table X values(myJB.getColumn1,myJB.getColumn2)";
     log.debug(query);
     stmt = conn.prepareStatement(query);
     stmt.executeUpdate();
     stmt.close();
  }
  </code></pre>
  
  <p>The log will show the correct order, i.e from x=0 to x=3.
  But select * from table X will result 4 rows but with different order</p>
  
  <p>How to force Oracle will insert in correct order as in ArrayList?</p>
  
  <p>Thanks</p>
  
  <ul>
  <li>ArrayList = row0,row1,row2,row3</li>
  <li>select * from Table X = row2,row3,row0,row1</li>
  </ul>