Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Paging Mechanism Without Component

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is a Stuff that u can use it for Previous-Next for Paging Mechanism for Moving thru RecordSet
<%@ page language="java"%>
<%@ page errorPage="error.jsp"%>
<%@ page import="java.sql.*,sun.jdbc.odbc.*" %>
<%!
ResultSet rs;
String a,b,c,d,tmp;
int pagesize=5;
int cp;
%>
<%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc dbc:jsptest","java","java");
Statement st=con.createStatement();
tmp=request.getParameter("mode");
if(tmp==null)
{
tmp="test";
}
//tmp=tmp.toString();
%>
<%if(tmp.equals("prev"))
{
cp=cp-1;
out.println("333");
}
else if(tmp.equals("next"))
{
cp=cp+1;
out.println("555");
}
else
{
cp=1;
out.println("666");
}
%>
<%out.println(cp);%>
<%
rs=st.executeQuery("SELECT * FROM course");
%>
<% int x=cp-1 * pagesize;
for(int i= 1;i<x;i++)
{
rs.next();
}
%>
<table border=0 cellpadding=2 cellspacing=2 width=100%>
<%
int c1=0;
out.println("Hello OUTside the ");
while(rs.next() && c1<pagesize)
{
out.println("Hello Inside the ");
%>
<tr>
<%
a=rs.getString("campus");
b=rs.getString("code");
c=rs.getString("DegreeTitle");
d=rs.getString("DegreeAwarded");
%>
<td align="center" vAlign="top" bgcolor="beige"><font face="verdana" size="1.5"><%= a%></b></font></td>
<td align="center" vAlign="top" bgcolor="beige"><font face="verdana" size="1.5"><%= b%></b></font></td>
<td align="center" vAlign="top" bgcolor="beige"><font face="verdana" size="1.5"><%= c%></b></font></td>
<td align="center" vAlign="top" bgcolor="beige"><font face="verdana" size="1.5"><a href="<%= d%>">More</a></b></font></td>
</tr>
<%
rs.next();
c1=c1+1;
}
%>
<A href="prevnext1.jsp?mode=prev"><< Previous Page</a>
<A href="prevnext1.jsp?mode=next">Nextpage>></a>
</table>
</body>
</html>


------------------
 
Jai Shankar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Its very useful and Time Saving Code
Use it
this JSP page takes place in All E-commerce Application ,No need to Use DATAOBJECTS as in ASP
 
Doe, a deer, a female deer. Ray, a pockeful of sun. Me, a name, I call my tiny ad ...
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic