Solved

Help me to implement the paging concept

Posted on 2002-03-12
8
753 Views
Last Modified: 2006-11-17
Hi guys i am new to Java, plz help me. My problem is ...

   I am trying to develop JSP page with paging navigations like page 1 of 10, when the user in page 1, he should see only the first 10 records. when he on second page, he should see only the 2nd 10 record.


   Is it possible to do this? Thanks in advance. (if possible, with sample code).
0
Comment
Question by:selvamtvl
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 9

Expert Comment

by:Venci75
ID: 6856108
How do you access these records?
0
 

Author Comment

by:selvamtvl
ID: 6856125
Thanks for your initialization Venci75.

     I don't know how to access but i need help from someone like you. I am using oracle 8i as my backend and oracle 9ias as my web and app server.

     Do you know how to solve this problem? I am using JDBC and using resultset.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 6856126
Listening on this pattern...
0
 

Author Comment

by:selvamtvl
ID: 6856143
Thanks for your initialization Venci75.

     I don't know how to access but i need help from someone like you. I am using oracle 8i as my backend and oracle 9ias as my web and app server.

     Do you know how to solve this problem? I am using JDBC and using resultset.
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 9

Accepted Solution

by:
Venci75 earned 100 total points
ID: 6856305
try this simple code:

<%
// creating connection to the DB
   java.sql.DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
   java.sql.Connection conn = java.sql.DriverManager.getConnection ("jdbc:oracle:oci8:@dbalias", "user", "pwd");
   java.sql.Statement stmt = conn.createStatement ();
   java.sql.ResultSet rset;
// check whether the result set has created.
// if so - reuse the existing one
   rset = (java.sql.ResultSet) session.getValue("rset");
   if (rset == null) {
// create result set - select query
     rset = stmt.executeQuery ("SELECT \"NAME\" AS title FROM MyTable");
     session.putValue("rset", rset);
   }
   for (int i = 0; i< 10; i++) {
     rset.next();
%>
  <%= rset.getString("title") %><br>
<%
  }
%>
<!-- 3.jsp is the name of my test jsp file. you shoud your jsp name in the href parameter -->
<a href="3.jsp">next 10</a><br>
0
 
LVL 9

Expert Comment

by:Venci75
ID: 7901864
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Answered by: Venci75
Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Venci75
EE Cleanup Volunteer
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 7902656
Fine by me...
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7962641
Per recommendation, force-accepted.

Netminder
EE Admin
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
This video teaches viewers about errors in exception handling.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now