Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Help me to implement the paging concept

Posted on 2002-03-12
8
Medium Priority
?
760 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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
 
LVL 9

Accepted Solution

by:
Venci75 earned 400 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
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…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

618 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