title: How to form Insert query dynamically in this case
body: <p>I have a input string seperated with @ symbol as shown </p>
  
  <pre><code>Popcorn@Bucket
  </code></pre>
  
  <p>I have a table as shown </p>
  
  <pre><code>mysql&gt; desc document;
  +-----------------+-------------+------+-----+---------+----------------+
  | Field           | Type        | Null | Key | Default | Extra          |
  +-----------------+-------------+------+-----+---------+----------------+
  | document_id     | int(11)     | NO   | PRI | NULL    | auto_increment |
  | T1              | varchar(50) | YES  |     | NULL    |                |
  | T2              | varchar(50) | YES  |     | NULL    |                |
  | T3              | varchar(50) | YES  |     | NULL    |                |
  | T4              | varchar(50) | YES  |     | NULL    |                |
  | T5              | varchar(50) | YES  |     | NULL    |                |
  | T6              | varchar(50) | YES  |     | NULL    |                |
  | T7              | varchar(50) | YES  |     | NULL    |                |
  | T8              | varchar(50) | YES  |     | NULL    |                |
  | T9              | varchar(50) | YES  |     | NULL    |                |
  | T10             | varchar(50) | YES  |     | NULL    |                |
  | vendor_brand_id | varchar(10) | YES  |     | NULL    |                |
  | vendor_id       | varchar(10) | YES  |     | NULL    |                |
  +-----------------+-------------+------+-----+---------+----------------+
  </code></pre>
  
  <p>Depending on the input i am trying to form an Insert query as shown </p>
  
  <pre><code> String reqstr = "Popcorn@Bucket"
  
  String valuess[] = reqstr.split("@");
  
  if (valuess.length == 1) {
  
  sql = "Insert into document (T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,vendor_brand_id,vendor_id) values ('"+valuess[0]+"',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,"+vendor_brand_id+","+vendor_id+") ";
  
  }
  else if (valuess.length == 2) {
  
  sql = "Insert into document (T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,vendor_brand_id,vendor_id) values ('"+valuess[0]+"','"+valuess[1]+"',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,"+vendor_brand_id+","+vendor_id+") ";
  
  }
  
  // Upto length 10 
  </code></pre>
  
  <p>My question is that how can i form this dynamically ??</p>