title: Save and retrieve multiple value given through jsp from database
body: <p>I have one jsp page where  I am selecting value using multiple option and sending to servlet and trying to store into database i Have selected two values through multiple option an error is coming like this .Net
                 Core Java,
   java.lang.ArrayIndexOutOfBoundsException: 2
   , here is my jsp code</p>
  
  <pre><code>                    &lt;tr&gt;
    &lt;td&gt;&lt;label&gt;Skills &lt;/label&gt;&amp;nbsp;&lt;/td&gt;
    &lt;td&gt;&lt;select name="skills" size="5" multiple="multiple" tabindex="1"&gt;
      &lt;option value="Android"&gt;Android&lt;/option&gt;
      &lt;option value=".Net"&gt;.Net&lt;/option&gt;
      &lt;option value="Core Java"&gt;Core Java&lt;/option&gt;
      &lt;option value="Advance Java"&gt;Advance Java&lt;/option&gt;
      &lt;option value="Database"&gt;Database&lt;/option&gt;
      &lt;option value="MySQL"&gt;MySQL&lt;/option&gt;
      &lt;option value="Html/CSS"&gt;Html/CSS&lt;/option&gt;
      &lt;option value="PHP"&gt;PHP&lt;/option&gt;
      &lt;option value="TESTING"&gt;TESTING&lt;/option&gt;
      &lt;option value="Networking"&gt;Networking&lt;/option&gt;
  
    &lt;/select&gt;
    &lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>and after that i am retrieving value in servlet like this..</p>
  
  <pre><code> String[] skills   =request.getParameterValues("skills");
      for(p=0;p&lt;skills.length;p++)
      {
  
      System.out.println(skills[p]);
      }
  </code></pre>
  
  <p>now storing into database like this....</p>
  
  <pre><code>  int i = st.executeUpdate("insert into empinfo(skills) values (+skills[p] + "')");
      if (i &gt; 0) {
  
    }
  </code></pre>
  
  <p>please  help me anyone here how to store and retrieve using jsp and servlet</p>
  
  <p>here is my table structure. </p>
  
  <pre><code>  CREATE TABLE IF NOT EXISTS `empinfo` (
       `eid` varchar(255) NOT NULL,
      `name` varchar(255) DEFAULT NULL,
    `password` varchar(255) DEFAULT NULL,
    `sex` varchar(50) NOT NULL,
     `dob` varchar(255) DEFAULT NULL,
    `bloodgroup` varchar(255) DEFAULT NULL,
    `fathername` varchar(300) DEFAULT NULL,
   `qualification` varchar(255) DEFAULT NULL,
   `mailid` varchar(400) DEFAULT NULL,
   `contactnum` varchar(200) DEFAULT NULL,
   `skills` varchar(1250) NOT NULL,
  `temporaryadd` varchar(600) DEFAULT NULL,
  `permanentadd` varchar(600) DEFAULT NULL,
  `access_type` varchar(150) DEFAULT NULL,
   PRIMARY KEY (`eid`)
  ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
  </code></pre>