title: Java H2 dynamically inserting data
body: <p>Good day to you all
  I am trying to import specified tables from access db to store it in a H2 embedded db to be used locally and update changes back to server (access) whenever connection is possible.
  But as code below shows i am stuck at inserting dynamically data to the newly created H2 database.
  I am getting this error
      org.h2.jdbc.JdbcSQLException: Column "1" not found; SQL statement:
      INSERT INTO Users  ( <code>ID_USER</code>, <code>Nt_id</code>, <code>Name</code>, <code>Level</code>, <code>Psw_Admin</code> ) VALUES ( <code>1</code> ,<code>*****</code> ,<code>*******</code> ,<code>ALL</code> ,<code>*****</code> ) [42122-181]</p>
  
  <p>As you see i have used preparedstatement, and used quotes (because the columns newly created are VARCHAR all) yet none of the above solved the issue
  here is my code of inserting:</p>
  
  <pre><code>                while (rs.next()){
  
                      String object="";
                      String item="";
                      for (int i=1;i&lt;=columncount;i++){
                          object=rs.getObject(i)+"";
  
                                   if (i==1){
                                      item="`"+item+object;
                                  }else if (i==columncount){
                                      item=item+"` ,`"+object+"`";
                                  } else{
                                      item=item+"` ,`"+object;
                                  }
                                  System.out.println(object);
                                  }
                      PreparedStatement pst3=conn2.prepareStatement("INSERT INTO Users "+" ( "+columnnamepst3+" ) VALUES ( "+item+" )");
  
                              pst3.executeUpdate();
                              pst3.close();
                              System.out.println("Done...next row");
                  }
  
                  rs.close();
  </code></pre>
  
  <p>rs is the result set from access db
  conn2 is the connection to H2</p>
  
  <p>EDIT1: corrected the code quoted
  Thanks in advance</p>