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
Solved

Help me to implement the paging concept

Posted on 2002-03-12
8
755 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

 

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

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

Suggested Solutions

Title # Comments Views Activity
hibernate example issues from command prompt 10 50
Java: anonymous class 4 29
Selenium docs api java index 3 48
Java program running SQL query 5 37
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

828 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