Solved

Help me to implement the paging concept

Posted on 2002-03-12
8
754 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

785 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