title: I have a data of list which I have to insert it in database using jdbc
body: <p>I have a data of list which I have to insert it in database using jdbc. My problem is that the size of list is not always constant, sometimes it gives <code>ArrayIndexOutOfBoundExp</code>. So I need to insert the record dynamically. </p>
  
  <p>Currently I am inserting records for list size 10, now if I get list of size 5 then?</p>
  
  <pre><code>public void setValues(PreparedStatement ps, int ean) throws SQLException {
  
      ps.setLong(1,Id);
  </code></pre>