title: how to retrieve data from database in front end textarea using jsp
body: <p>I want to edit student details .I am able to retrieve all fields by giving the rollno as input except the textarea field from database. how to retrieve data into textarea from database.here address field is textarea.I am not able to retrieve address from database</p>
  
  <pre><code>editstudent.jsp
  &lt;body&gt;  
  
          &lt;!--&lt;form id="frmExamRegistration" method="post" enctype="multipart/form-data" class="anu"&gt;--&gt;
  
  
      &lt;form name="f1" method="post" class="anu" action="Edit_studentdetails.jsp"&gt;  
      &lt;%@include file="adminheader.jsp"%&gt;
  &lt;%@include file="sidemenus.jsp" %&gt;
  
      &lt;div id="container"&gt;
                &lt;div  style="float:right;width:10%;border:0;font-color:#163362"&gt;&lt;a href=logout.jsp"&gt;Log Out&lt;/a&gt;&lt;/div&gt;&lt;br&gt;
          &lt;div class="content"&gt;&lt;center&gt;Edit Student&lt;/center&gt;&lt;br&gt;
              &lt;div class="formElements,rightcol" align="center"&gt;
                  &lt;label&gt;Rollno:
                   &lt;span&gt;&lt;input type="text" id="txtRollno" name="txtRollno" &gt;&lt;/span&gt;&lt;/label&gt;
                         &lt;/div&gt;&lt;br&gt;
  
  
  
              &lt;div class="buttons"&gt;
                  &lt;button type="submit" class="primaryAction"&gt;Edit&lt;/button&gt;
                                  &lt;button type="reset" class="primaryAction"&gt;Clear&lt;/button&gt;
  
              &lt;/div&gt;
                   &lt;/div&gt;
           &lt;/div&gt;
         &lt;/form&gt;
    &lt;/body&gt;
  
  
  edit_studentdetails.jsp
  
  &lt;body&gt;  
      &lt;form name="f1" method="post" class="anu" action="Update_studentdetails.jsp"&gt;  
      &lt;%@include file="adminheader.jsp"%&gt;
      &lt;%@include file="sidemenus.jsp" %&gt;
      &lt;%@include file="jsp/jdbcresults.jsp" %&gt;
      &lt;%  
  
                  Connection dbConnection = con;
  
      String Rollno=request.getParameter("txtRollno");
          String BatchCode="";
          String CourseCode="";
          String Fullname="";
          String Fathername="";
          Date DOB=null;
          String fmtdob=null;
          String Gender="";
          Date DOJ=null;
          String fmtdoj=null;
          String Email="";
          String Phone="";
          String address=null;
          String Hallticketno="";
          java.text.SimpleDateFormat formatter=new java.text.SimpleDateFormat("dd-mm-yyyy");
       //   String Photo=request.getParameter("txtPhoto");
  
  
  try 
                  {
  
  String selectStoredProc = "SELECT * FROM STUDENTS WHERE ROLLNO = '"+Rollno+"'";
  
                          PreparedStatement ps = dbConnection.prepareStatement(selectStoredProc);
                      ResultSet rs=ps.executeQuery();
                      while(rs.next()) {
                        Rollno = rs.getString("rollno");
  
                    BatchCode=rs.getString("batchcode");
                            CourseCode=rs.getString("ccode");
                            Fullname=rs.getString("fullname");
                            Fathername=rs.getString("fathername");
                                            DOB=rs.getDate("dob");
                                            // fmtdob =formatter.format(DOB);
                            Gender=rs.getString("gender");
                            DOJ=rs.getDate("doj");
                                           // fmtdoj =formatter.format(DOJ);
                                Email=rs.getString("email");
                            Phone=rs.getString("phone");
                            address=rs.getString("address");
                            Hallticketno=rs.getString("hallticketno");
                      }
                      rs.close();
                      rs = null;
  
  
                  } 
                  catch (Exception e) {
                      System.out.println(e.getLocalizedMessage());
                  }
                  finally {
  
  
                      if(dbConnection != null){
                          dbConnection.close();
                          dbConnection = null;
                      }
                  }
  
      %&gt;
      &lt;div id="container"&gt;
                &lt;div  style="float:right;width:10%;border:0;font-color:#163362"&gt;&lt;a href=logout.jsp"&gt;Log Out&lt;/a&gt;&lt;/div&gt;&lt;br&gt;
          &lt;div class="content"&gt;&lt;center&gt;Edit Student Details&lt;/center&gt;&lt;br&gt;
              &lt;div class="formElements,rightcol" align="center" width="100%"&gt;
  
  
  
                                   &lt;label&gt;Roll no:
                   &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp;&lt;span&gt;&lt;input type="text" id="txtRollno" name="txtRollno" value="&lt;%= Rollno%&gt;" readonly='true'&gt;&lt;/span&gt;&lt;/label&gt;&lt;br&gt;
  
                  &lt;label&gt;Batch code:
                   &amp;nbsp&amp;nbsp&amp;nbsp;&lt;span&gt;&lt;input type="text" id="txtBatchcode" name="txtBatchcode" value="&lt;%= BatchCode%&gt;" readonly='true'&gt;&lt;/span&gt;&lt;/label&gt;&lt;br&gt;
  
  
                  &lt;label&gt;Course code:
                   &lt;span&gt;&lt;input type="text" id="txtCoursecode" name="txtCoursecode" value="&lt;%= CourseCode %&gt;" readonly='true'&gt;&lt;/span&gt;&lt;/label&gt;&lt;br&gt;
  
                  &lt;label&gt;Full Name:
                  &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp;&lt;span&gt;&lt;input type="text" id="txtFullname" name="txtFullname" value="&lt;%= Fullname %&gt;" &gt;&lt;/span&gt;&lt;/label&gt;&lt;br&gt;
  
                  &lt;label&gt;Father Name:&amp;nbsp
                   &lt;span&gt;&lt;input type="text" id="txtFathername" name="txtFathername" value="&lt;%= Fathername %&gt;" &gt;&lt;/span&gt;&lt;/label&gt;&lt;br&gt;
  
                  &lt;label&gt;Date Of Birth:&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp
                                  &lt;input type="date" name="txtDob" id="txtDob" value="&lt;%= DOB %&gt;" &gt;&lt;/label&gt;&lt;br&gt;
  
  
  
                  &lt;label&gt;&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp;Gender:
                      &lt;% if (Gender.equals("male")){%&gt;
                                     &lt;input type=Radio name='txtGender' value='male' checked='true'&gt; Male
                                       &lt;%}else{%&gt;
                                     &lt;input type=Radio name='txtGender' value='male'&gt;Male
                       &lt;%} if (Gender.equals("female")){%&gt;
                     &lt;input type=Radio name='txtGender' value='female' checked='true'&gt; Female&lt;/td&gt;&lt;/tr&gt;
                       &lt;%}else{%&gt;
                     &lt;input type=Radio name='txtGender' value='female'&gt;&lt;b&gt; Female&lt;/td&gt;&lt;/tr&gt;
                       &lt;%}%&gt;&lt;/label&gt;&lt;br&gt;
  
                                 &lt;label&gt;&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp;Date Of Join:
                   &lt;input type="date" name="txtDoj" id="txtDoj" value="&lt;%= DOJ %&gt;" &gt;&lt;/label&gt;&lt;br&gt;
  
                                  &lt;label&gt;Email id:
                   &amp;nbsp&amp;nbsp&amp;nbsp;&lt;span&gt;&lt;input type="text" id="txtEmailid" name="txtEmailid" value="&lt;%= Email %&gt;"  &gt;&lt;/span&gt;&lt;/label&gt;&lt;br&gt;
  
                                  &lt;label&gt;Phone No.:
                   &amp;nbsp&amp;nbsp&amp;nbsp;&lt;span&gt;&lt;input type="text" id="txtPhoneno" name="txtPhoneno" value="&lt;%= Phone %&gt;" &gt;&lt;/span&gt;&lt;/label&gt;&lt;br&gt;
  
                                 &lt;label&gt;Address:
                   &amp;nbsp&amp;nbsp&amp;nbsp;&lt;span&gt;&lt;textarea rows="4" cols="30" name="txtaddress" id="txtaddress" textareaObject.value="text" value="&lt;%= address %&gt;" &gt;&lt;/textarea&gt;&lt;/span&gt;&lt;/label&gt;&lt;br&gt; 
  
                                 &lt;label&gt;Hall ticket no.:
                   &amp;nbsp&amp;nbsp&amp;nbsp;&lt;span&gt;&lt;input type="text" id="txtHallticketno" name="txtHallticketno"  value="&lt;%= Hallticketno%&gt;" &gt;&lt;/span&gt;&lt;/label&gt;&lt;br&gt;
  
                               &lt;!--&lt;label&gt;Photo:
                                  &lt;input type="file" id="txtPhoto" name="txtPhoto" &gt;&lt;/span&gt;&lt;/label&gt;&lt;br&gt;--&gt;
                          &lt;/div&gt;
  
  
              &lt;div class="buttons"&gt;
                  &lt;button type="submit" class="primaryAction"&gt;Edit&lt;/button&gt;
                  &lt;button type="reset" class="primaryAction"&gt;Clear&lt;/button&gt;
              &lt;/div&gt;
            &lt;/div&gt;
           &lt;/div&gt;
         &lt;/form&gt;
    &lt;/body&gt;
  
  
  update_studentdetails.jsp
  
  
  &lt;body &gt;  
  
          &lt;!--&lt;form id="frmExamRegistration" method="post" enctype="multipart/form-data" class="anu"&gt;--&gt;
  
  
      &lt;form name="f1" method="post" class="anu"&gt;  
  &lt;table  valign="top" height="800" width="1024"&gt; 
  &lt;tr&gt;&lt;td colspan="2"&gt;&lt;%@include file="adminheader.jsp"%&gt;&lt;/td&gt;&lt;/tr&gt;
  
  
      &lt;!--&lt;div id="container"&gt;
  &lt;div class="content"&gt;&lt;center&gt;&lt;h4&gt; Grades&lt;/h4&gt;&lt;/center&gt; --&gt;
  
  &lt;tr&gt;&lt;td colspan="2" bgcolor="#A1A1AE"&gt;
                &lt;div  style="float:right;width:10%;border:0;font-color="ffffff";"&gt;&lt;a href=logout.jsp"&gt;Log Out&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;tr&gt;&lt;td height="600" valign="top"&gt;      
  &lt;%@include file="sidemenus.jsp" %&gt;&lt;/td&gt;
  
  &lt;td&gt;
  
  &lt;%@include file="jsp/jdbcresults.jsp" %&gt;
  &lt;%
       // Hope you are getting the connection part  
                  CallableStatement cstmt=null;
          String Rollno=request.getParameter("txtRollno");
          String BatchCode=request.getParameter("txtBatchcode");
          String CourseCode=request.getParameter("txtCoursecode");
          String Fullname=request.getParameter("txtFullname");
          String Fathername=request.getParameter("txtFathername");
          String DOB=request.getParameter("txtDob");
          String Gender=request.getParameter("txtGender");
          String DOJ=request.getParameter("txtDoj");
          String Email=request.getParameter("txtEmailid");
          String Phone=request.getParameter("txtPhoneno");
          String Address=request.getParameter("txtaddress");
          String Hallticketno=request.getParameter("txtHallticketno");
  
   try {
  cstmt=con.prepareCall("{call udp_modifystudent(?,?,?,?,?,?,?,?,?,?,?,?)}");
                  cstmt.setString(1,Rollno);
                  cstmt.setString(2,BatchCode); 
                  cstmt.setString(3,CourseCode);                
                  cstmt.setString(4,Fullname);  
                  cstmt.setString(5,Fathername);  
                  cstmt.setString(6,DOB);  
                  cstmt.setString(7,Gender);  
                  cstmt.setString(8,DOJ);  
                  cstmt.setString(9,Email);  
                  cstmt.setString(10,Phone);  
                  cstmt.setString(11,Address);  
                  cstmt.setString(12,Hallticketno);  
                  cstmt.executeUpdate(); 
  
                 out.print("Student updated successfully");
         }
         catch(Exception e){
          out.print("Exception: "+e.getMessage());
                  }
         finally {
         cstmt.close();
         con.close();
         }
  
  %&gt;
  &lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;&lt;/form&gt;&lt;/body&gt;
  </code></pre>