title: How to store array in database in multiple columns and every n-th array element start storing from first column (Java and OracleXE213)
body: <p>I am working on one interesting project. I have text file (it is lot longer by rows, and lines are approximately 800 chars-the actual size does not matter because it can change) that looks like this:</p>
  <p>MyNameoooDDMMGGGMyAdressoooMYDogNameooo000088800000888777
  YourNameoDDMMGGGYourAdressoYourDogNameo000088800000888666
  MyNameoooDDMMGGGMyAdressoooMYDogNameooo0000888000008887777</p>
  <p>And so on...</p>
  <p>I have managed to read file, split lines and store it in to List.
  Console output of the List (<code>copy()</code>) looks like this:</p>
  <ul>
  <li>MyName000</li>
  <li>DDMMGGG</li>
  <li>MyAdress000</li>
  <li>MYDogName000</li>
  <li>0000888</li>
  <li>00000888</li>
  <li>777</li>
  <li>YourName*</li>
  <li>DDMMGGG</li>
  <li>YourAdress0</li>
  <li>YourDogName0</li>
  <li>0000888</li>
  <li>00000888</li>
  <li>666</li>
  <li>MyName000</li>
  <li>DDMMGGG</li>
  <li>MyAdress000</li>
  <li>MYDogName000</li>
  <li>0000888</li>
  <li>00000888</li>
  <li>777</li>
  </ul>
  <p>and so on..</p>
  <p>Now the fun part is to store that data in to database. Starting from <strong>MyName000</strong> to <strong>column1</strong> and to last peace of data of first line <strong>777</strong> to last <strong>column7</strong> and from second line<strong>YourName0</strong> to first <strong>column1</strong>....last piece of data in second line <strong>666</strong> to last <strong>column7</strong>.
  Note: For now I have 60 columns in database and text file have around 200 000 lines. It is big.</p>
  <p>Code for database entry:</p>
  <pre><code>try {
  
              PreparedStatement statement = connect.prepareStatement(prep);
              
              for (int i = 0; i &lt; copy.size()-1; i++) {
                  
                  for (int j = 0; j &lt; listOfColumns.length - 1; j++) {
                      
                      statement.setString(j + 1, copy.get(j));
  
                      //statement.addBatch();
                       statement.execute();
                      
                  }
                  //statement.executeBatch();
                   statement.executeUpdate();
  
              }
  
          } catch (Exception e) {
              e.printStackTrace();
  
          }
  </code></pre>
  <p>'''
  I have tried lot's of things, and I don't know is this right way to do this task from the start.
  I got error:</p>
  <p>java.sql.SQLException: Missing IN or OUT parameter at index:: 2
  at com.oracle.database.jdbc/oracle.jdbc.driver.OraclePreparedStatement.processCompletedBindRow(OraclePreparedStatement.java:2033)
  at com.oracle.database.jdbc/oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3751)
  at com.oracle.database.jdbc/oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:4136)
  at com.oracle.database.jdbc/oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1014)
  at Demo.main(Demo.java:69)</p>
  <p><code>statement.execute();</code> is at line 69</p>
  <p>prepstatment:</p>
  <pre><code>String prep= &quot;insert into AAA&quot;
                  + &quot;(column1, column2, column3, colum4, column5, column6,&quot;
                  + &quot; column7)&quot;
                  + &quot; VALUES(?,?,?,?,?,?,?)&quot;;
  </code></pre>
  <p>listo of columns:</p>
  <pre><code>String listOfColumns[] = { &quot;column1&quot;, &quot;column2&quot;, &quot;column3&quot;, &quot;column4&quot;,
                  &quot;column5&quot;, &quot;column6&quot;, &quot;column7&quot; };
  </code></pre>
  <p>With iterator it is same thing:</p>