strony mądre wyniki wyświetlane na stronie jsp

Mam stronę wyszukiwania JSP, która akceptuje niektóre pola wejściowe i wysyła zapytanie do bazy danych z odpowiednimi polami. jeśli w bazie danych znajduje się 2000 odpowiednich rekordów, strona pokaże pierwsze 30 wyników, a następny przycisk pokaże kolejne wyniki lub poprzedni przycisk dla poprzednich wyników, tak jak podczas wyszukiwania w Google. Teraz mój problem polega na tym, że nie mam pojęcia, jak to zrobić. Znam podstawowe serwlety, JSP, JDBC. czy jest ktoś, kto rozwiązuje ten problem? sugestie i pomysły są najbardziej cenione. kod będzie taki

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ page import = "com.preva.vo.StoppageDetails"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<html>
<head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<link href="css/cal.css" rel="stylesheet" type="text/css" />
<link href="css/sty.css" rel="stylesheet" type="text/css" />
<link href="css/tabborder.css" rel="stylesheet" type="text/css" />
</head>
<body>
                 <jsp:include page="Header.jsp" />

            <table align=center border=0 cellspacing=0 cellpadding=0>
            <tr ><td colSpan=5 align=center><b>Overspeed Details</b></td></tr>
            <tr >
      <td colspan=5 align=center>
      <b><%=request.getParameter("vehicleId") %></b></td></tr>
            <tr><td>From &nbsp;
    <%=session.getAttribute("fromdate") %>
     &nbsp;to&nbsp;       
     <%=session.getAttribute("startdate") %></td></tr>

            </table><br></br>
     <table class='rptTbl_sortable' width='80%' align=center cellspacing='2'  cellpadding='0' border='0'>

          <thead>
          <tr class="rptHdrRow">
         <th id="index" class="rptHdrCol_sort" nowrap>DeviceID</th>
         <th id="date" class="rptHdrCol_sort" nowrap>Date</th>
         <th id="time" class="rptHdrCol_sort" nowrap>Speed</th>
         <th id="statusdesc" class="rptHdrCol_sort" nowrap>Status</th>
                 <th id="address" class="rptHdrCol_sort" nowrap>Address</th>
</tr>
</thead>
<tbody>

<c:forEach items="${sessionScope.overspeeddetails}" var="overspeeddetailsvar">
<tr class="rptBodyRowOdd">
<td><c:out value="${overspeeddetailsvar.deviceID}"></c:out></td>
<td><c:out value="${overspeeddetailsvar.TIMESTAMP}"></c:out></td>   
<td><c:out value="${overspeeddetailsvar.speed}"></c:out></td>
<td><c:out value="${overspeeddetailsvar.statuscode}"></c:out></td>
<td><c:out value="${overspeeddetailsvar.address}"></c:out></td>

</tr>
<tr class="rptBodyRowEven">
<td><c:out value="${overspeeddetailsvar.deviceID}"> </c:out>  </td>
<td><c:out value="${overspeeddetailsvar.TIMESTAMP}"></c:out></td>   
<td> <c:out value="${overspeeddetailsvar.speed}"></c:out></td>
<td><c:out value="${overspeeddetailsvar.statuscode}"></c:out></td>
<td><c:out value="${overspeeddetailsvar.address}"></c:out></td>

</tr>   </c:forEach>    
    </tbody>            


        </table> 


 </body>

  </html>

klasy fasoli i Dao będą takie

public class OverspeedDetails {
private String  deviceID,timestamp,statuscode,address;
private double speed;
public double getSpeed() {
    return speed;
}

public void setSpeed(double speed) {
    this.speed = speed;
}

public String getDeviceID() {
    return deviceID;
}

public void setDeviceID(String deviceID) {
    this.deviceID = deviceID;
}

public String getTIMESTAMP() {
    return timestamp;
}

public void setTIMESTAMP(String TIMESTAMP) {
    this.timestamp = TIMESTAMP;
}

public String getStatuscode() {
    return statuscode;
}

public void setStatuscode(String statuscode) {
    this.statuscode = statuscode;
}

public String getAddress() {
    return address;
}

public void setAddress(String address) {
    this.address = address;
}

public List<OverspeedDetails> getosDetails(String accountID,String deviceID,String   Timestamp1,String Timestamp2,double speed) {
        Connection con=null;
        List<OverspeedDetails> overspeeddetail = new ArrayList<OverspeedDetails>();
        try{


            con= DBConnectionFactory.getDBConnection();

            String sql="SELECT deviceID,TIMESTAMP,speedKPH,statuscode,address  FROM eventdata WHERE (TIMESTAMP BETWEEN '"+Timestamp1+"' AND '"+Timestamp2+"') AND accountID='"+accountID+"' AND deviceID='"+deviceID+"'and speedKPH >"+speed+";";
            Statement st=con.createStatement();
            ResultSet rs=st.executeQuery(sql);
            System.out.println("Dao over"+rs.next());
            while (rs.next()){
                OverspeedDetails od=new OverspeedDetails();
                od.setDeviceID(rs.getString(1));
                String stringtimestamp=rs.getString(2);
                 long l=Long.parseLong(stringtimestamp);
                 long longtimestamp = l * 1000L;
                 String str = new java.text.SimpleDateFormat("dd/MM/yyyy").format(new java.util.Date(longtimestamp));

                    od.setTIMESTAMP(str);
                od.setSpeed(rs.getDouble(3));
                od.setStatuscode(rs.getString(4));
                String add=rs.getString(5);
                String add1[]=add.split(" \\d");
                //String add2=java.util.Arrays.toString(add.split(" "));
                od.setAddress(add1[0]);
                overspeeddetail.add(od);
              } 

            }catch (Exception e) {
                e.printStackTrace();

            }
        System.out.println(overspeeddetail);
            return overspeeddetail;


        }

questionAnswers(1)

yourAnswerToTheQuestion