You can jump to a specific page by using the dropdown box
<script language= "JavaScript" >
function Gopage ()
{
Document.listpage.submit ();
}
function PreviousPage ()
{
if ((parseint (Document.listpage.page.value)) < 1)
Document.listpage.page.value = 1;
Else
{
Document.listpage.page.value = parseint (document.listpage.page.value)-1;
Document.listpage.submit ();
}
}
function NextPage ()
{
Document.listpage.page.value = parseint (document.listpage.page.value) + 1;
Document.listpage.submit ();
}
function Gopagebyno (PageNo)
{
Document.listpage.page.value = PageNo;
Document.listpage.submit ();
}
</script>
<%
Connection M_connection=null;
Statement M_statement=null;
ResultSet M_resultset=null;
String SQL;
String DBPath = Application.getrealpath ("/Database Location"); Convert a relative path into a physical path
String connstr = "Jdbc:odbc:driver={microsoft Access Driver (*.mdb)};D bq=" +dbpath;
Class.forName ("Sun.jdbc.odbc.JdbcOdbcDriver");
M_connection=drivermanager.getconnection (CONNSTR);
M_statement=m_connection.createstatement (1004,1007);
sql= query statement;
M_resultset=m_statement.executequery (SQL);
%>
<div>
<table class= "list" width= "580" >
<%
int i=1;
int rscount=0;//Record Bar number
int allpages=1;//All pages
if (m_resultset!=null)
{m_resultset.last ();
Rscount=m_resultset.getrow ();
if (rscount>0)
{ALLPAGES=RSCOUNT/10;
if (rscount> (Allpages *)) {allpages=allpages+1;}
if (curpage==1) {M_resultset.first ();}
Else{m_resultset.absolute (10* (curpage-1) +1);}
while (!m_resultset.isafterlast ())
{%>
<TR valign= "Top" height= ">"
<td><%=m_resultset.getstring ("D_d_name")%></td>
<td><%=m_resultset.getstring ("D_t_name")%></td>
<td><input style= "margin:0px type=" button "Name=" Submit2 "onclick=" Actiondo (' del ', ' <%=m_ Resultset.getstring ("d_d_id")%> ', ' <%=curpage%> ') "value=" delete "><input style=" margin:0px; "Type=" Button "Name=" Submit3 "onclick=" Actiondo (' edit ', ' <%=m_resultset.getstring ' d_d_id ')%> ', ' <%=curpage%> ') ' value= "edit" ></td>
</tr>
<%
i++;
if (i>10) {break;}
M_resultset.next ();
}
}
M_resultset.close ();
}
%>
</table>
</div>
<div align= "center" >
<form name= "Listpage" >
<font color= ' #000080 ' > page:</font>
<b><font color=red><%=curpage%></font></b><font color= ' #000080 ' >/<b> <%=allpages%></b> </font>
<font color= ' #000080 ' >
<% if (curpage!=1)
{Out.print ("<a href= ' Javascript:gopagebyno (1) ' > Home </a>");}
Else
{Out.print ("Home");}
%>
</font>
<font color= ' #000080 ' >
<%if (Curpage!=1)
{Out.print ("<a href= ' javascript:previouspage () ' > Prev </a> ');}
Else
{out.print ("Up page");}
%>
</font>
<font color= ' #000080 ' >
<% if (allpages!=0&& (curpage<allpages))
{Out.print ("<a href= ' javascript:nextpage () ' > next page </a>");}
Else
{out.print ("next page");}
%>
</font>
<font color= ' #000080 ' >
<% if (allpages!=0&& (curpage<allpages))
{Out.print ("<a href= ' Javascript:gopagebyno (" +allpages+ ") ' > Last </a> ');}
Else
{Out.print ("last");}
%>
</font>
<select name= "page" onchange= "Javascript:gopagebyno (document.listpage.page.value)" >
<%for (i=1;i<=allpages;i++)
{if (curpage==i) {out.print ("<option value= '" +i+ "' selected= ' selected ' >" +i+ ' </option> ");}
Else{out.print ("<option value=" "+i+" ' > "+i+" </option> ");}
}
%>
</select>
</form>
</div>