title: Inserting array elements sequentially into a database java
body: <p>So for example if I have an array list of strings, how do I put them into a database sequentially. 
  For example if my array list is: "john", "sally", "rob"
  How can I come put that into my database such that row 1 is john, row 2 is sally, row 3 is rob. 
  I was thinking something along the lines of:</p>
  
  <pre><code>for(int i = 0; i &lt; array.size(); i++){
       query = "insert into database values(i);
  }
  </code></pre>
  
  <p>But I am not sure if that is the correct approach because I will also be inserting other values into the database other than the array.</p>