title: I just get the last table record?
body: <p>I am trying to get the values that inserted into the database dynamically but I just got the last record using servlet and jsp. This my ado implementation </p>
  
  <pre><code>    String sql = "SELECT * FROM  eductional_details where schoolname=?"; //To change body of generated methods, choose Tools | Templates.
              educatiodetails educat = null;
  
      try {
          PreparedStatement ps = (PreparedStatement) con
                  .prepareStatement(sql);
  
                      ps.setString(1, schoolname );
          ResultSet rs = ps.executeQuery();
          while (rs.next()) {
  
                      educat = new educatiodetails();
  
                      String DateFrom = rs.getString("datForm");
                      String DateTo = rs.getString("DatTo");
                      String DiscriptDetails = rs.getString("Descript");
  
                       educat.setSchoolname(schoolname);
                       educat.setDataform(DateFrom);
                       educat.setDatato(DateTo);
                       educat.setDiscription(DiscriptDetails);
  
                      }
  </code></pre>
  
  <p>And here my servlet side </p>
  
  <pre><code>  String[] schoolname = request.getParameterValues("shoolname");
           String[] dataform = request.getParameterValues("Dateform");
           String[] datato = request.getParameterValues("Datato");
           String[] discription = request.getParameterValues("Dscript");
  
           for ( int i = 0 ; i &lt; schoolname.length;i++ ) {
              educatiodetails edu = new educatiodetails();
                       edu.setSchoolname(schoolname[i]);
                       edu.setDataform(dataform[i]);
                       edu.setDatato(datato[i]);
                       edu.setDiscription(discription[i]);
  
                       EducatiIMP education = new EducatiIMP();
                       education.addEducation(edu); 
                       HttpSession session = request.getSession(true);
  
                           addEducation.getList();
                           EducatiIMP ado = new EducatiIMP();
  
                          educatiodetails educat =   ado.geteducatiodetails(schoolname[i].toString());
                          session.setAttribute("educat",educat);
  </code></pre>
  
  <p>and here my jsp viewer </p>
  
  <pre><code>&lt;c:forEach items="${educat}" var="item" varStatus="state" &gt;
                &lt;p&gt;&lt;c:out value="${item.schoolname}"/&gt;&lt;/p&gt;
   &lt;/c:forEach&gt;
  </code></pre>
  
  <p>I tried for each but I got only the last recorded form my database, the insert working fine just the select or retrieve the user information not work well.</p>