Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can use displaytag for paigination or resultset but u download some jar file from displattag</p> <p>first you create one servlet StudentList.java</p> <pre><code>public class StudentList extends HttpServlet </code></pre> <p>{ public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {</p> <pre><code> ArrayList al=new ArrayList(); StudentDao stdo=new StudentDao(); // this is DAO Class (Data Acccess Object) try { al=stdo.getStudentList(); //getstudent list dao method } catch (SQLException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } request.setAttribute("al",al); RequestDispatcher rd=request.getRequestDispatcher("StudentPaging.jsp"); rd.forward(request,response); } </code></pre> <p>}</p> <p>// dao method</p> <pre><code>public ArrayList getStudentList() throws SQLException,Exception { ArrayList ai=new ArrayList(); Connection con=null; Statement st=null; ResultSet rs=null; Date dt=new Date(); SimpleDateFormat sdf=new SimpleDateFormat("dd/MM/yyyy"); StudentInformation sdata=null; con=MyConnection.creatConnection(); if(con!=null) { st=con.createStatement(); String select="select * from STUDENT"; System.out.println(select); rs=st.executeQuery(select); if(rs!=null) { while(rs.next()) { sdata=new StudentInformation(); sdata.setSid(rs.getString("SID")); sdata.setFirstName(rs.getString("FIRSTNAME")); sdata.setMiddleName(rs.getString("MIDDLENAME")); sdata.setLastName(rs.getString("LASTNAME")); dt=rs.getDate("SDATE"); sdata.setDateofbirth(sdf.format(dt)); sdata.setGender(rs.getString("GENDER")); sdata.setAddress(rs.getString("ADDRESS")); sdata.setHigestQulification(rs.getString("HIQULIFICATION")); sdata.setLanguageKnow(rs.getString("LANGUAGE")); sdata.setHobby(rs.getString("HOBBY")); sdata.setTermCondition(rs.getString("TERMCON")); ai.add(sdata); } } } return ai; } </code></pre> <p><img src="https://i.stack.imgur.com/LuH4s.png" alt="enter image description here"></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload