pagination problem 0 Answer(s) 3 years and 3 months ago
Posted in : JSP-Servlet
Thanks sir for posting the answer.But i have 2 problems
1.i have created one employee class in that i use getter and setter methods,i created another class in that i wrote the methods like modify(),delete(),insert() methods using or importing employee class.finally i created a class using servlets in that i called a these methods,to call this servlet i created a html file i wrote one form to call this servlet. In this servlet i used doget()method in that i created a 2 forms to call a methods like insert() and modify(),my problem is that where i have to put & how to do pagination? my code as follows.
if (strServletPath.equalsIgnoreCase("/new.do")) { out.println("<html>"); out .println("<body bgcolor='pink'><h3>Hello User Enter The Following.....</h3>"); out.println("<form action='./newuser.do' method='get'>"); out.println("<table>"); out .println("<tr><td>Enter Your First Name</td><td><input type='text' name='fstname'></td></tr>"); out .println("<tr><td>Enter Your Last Name</td><td><input type='text' name='lstname'></td></tr>"); out .println("<tr><td>Enter Your Address</td><td><input type='text' name='add'></td></tr>"); out .println("<tr><td>Enter Your Phone Number</td><td><input type='text' name='phno'></td></tr>"); out .println("<tr><td>Enter Your Email ID</td><td><input type='text' name='emailid'></td></tr>"); out .println("<tr><td>Enter Your Status</td><td><input type='text' name='status'></td></tr>"); out .println("<tr><td colspan='1' align='center'><input type='submit' value='Click Here To Submit'></td></tr>");
out.println("</table></form></body>");
out.println("</html>");
} else if (strServletPath.equalsIgnoreCase("/newuser.do")) {
boolean blnIsValid = false; resultSet = statement.executeQuery("SELECT * FROM EMPLOYEE"); while (resultSet.next()) { if ((strFirstName.equalsIgnoreCase(resultSet .getString("EMP_FIRSTNAME"))) && (strLastName.equalsIgnoreCase(resultSet .getString("EMP_LASTNAME")))) { blnIsValid = true; break; }
} if (blnIsValid) { out.println("<html>"); out.println("<body bgcolor='pink'>"); out.println("<h3>After Modification Your Personal Details As Follows :</h3>"); out.println("<br>Your Emp_id :"+ resultSet.getInt("EMP_ID")); out.print("<br>Your First Name :" + strFirstName); out.print("<br>Your Last Name :" + strLastName); out.print("<br>Your Address :" + strAddress); out.print("<br>Your Phone Number :" + strPhoneNumber); out.print("<br>Your Email ID :" + strEmailId); out.print("<br>Your Status :" + strStatus); out.println("<br><br> <a href='./html/login.html'> Click Here To Go Home Page </a>"); out.println("<br><br> <a href='./empsumm.do'>Click Here To Go Employee Summery </a>"); out.println("</body></html>"); } }
else if (strServletPath.equalsIgnoreCase("/delete.do")) {
String strEmpId = request.getParameter("empid"); System.out.println("******* empid in delete method Is ******" + strEmpId);
out.println("<html>"); out.println("<body bgcolor='skyblue'><form action='./rowdelete.do' method='get'>"); out.println("<h3>Are You Sure Want To Delete The Record....Where Emp_Id="+strEmpId+"</h3><input type='hidden' value='"+strEmpId+"' name='empid'><input type='submit' value='Yes'>"); out.println("<br><br> <a href='./empsumm.do'>Are Else Click Here To Go Employee Summery </a>"); out.println("</body></html>");
} else if (strServletPath.equalsIgnoreCase("/rowdelete.do")) { String strEmpId=request.getParameter("empid");
int intEmpId = Integer.parseInt(strEmpId); EmployeeDataBase empDB = new EmployeeDataBase(); empDB.deleteRow(intEmpId);
out.println("<html>"); out.println("<body bgcolor='+9999-999123blue'><form action='rowdelete.do' method='get'>"); out.println("<h3>The Employee Details Completely Deleted!!!!!!!!</h3>"); out.println("<br><br> <a href='./html/login.html'> Click Here To Go Home Page </a>"); out.println("</body></html>");
public void deleteRow(int pintEmpid) { @SuppressWarnings("unused") ResultSet resultSet=null; try { statement.executeUpdate("delete employee where emp_id="+pintEmpid); resultSet =statement.executeQuery("SELECT * FROM EMPLOYEE"); } catch (SQLException e) { e.printStackTrace(); }
} }
//login.html
<html> <body bgcolor="blue"> <marquee bgcolor="violet"> <h2 dir="rtl">** Hello Welcome To **</h2> </marquee> <br> <br> <h1 align="center">Antares Systems Limited</h1> <br> <br> <form action="../empsumm.do" method="get"> <center > <input type="submit"value="Click To See Employee Summary "> </center> </form> </body> </html>
//Employee.java
package com.antares.To;
public class Employee {
int intEmpid; String emp_fristName; String emp_lastName; String emp_address; int emp_phone; String emp_email; String emp_status;
public int getIntEmpid() { return intEmpid; } public void setIntEmpid(int intEmpid) { this.intEmpid = intEmpid; } public String getEmp_fristName() { return emp_fristName; } public void setEmp_fristName(String emp_fristName) { this.emp_fristName = emp_fristName; } public String getEmp_lastName() { return emp_lastName; } public void setEmp_lastName(String emp_lastName) { this.emp_lastName = emp_lastName; } public String getEmp_address() { return emp_address; } public void setEmp_address(String emp_address) { this.emp_address = emp_address; } public int getEmp_phone() { return emp_phone; } public void setEmp_phone(int emp_phone) { this.emp_phone = emp_phone; } public String getEmp_email() { return emp_email; } public void setEmp_email(String emp_email) { this.emp_email = emp_email; } public String getEmp_status() { return emp_status; } public void setEmp_status(String emp_status) { this.emp_status = emp_status; }
}
2.please tell me the how to do the delete().i done but it is accessing the last row employeeid ,so how to get the empid of which we are clicking to delete.
I m sending my full code ,please replay me.......
View Answers
Related Pages:
pagination
code of pagination. In the given code,we have taken the database table student...;Pagination of JSP page</h3>
<body>
<form>
<input type="hidden... for you.
here problem is that : suppose i have 10 questions and i
pagination problem - JSP-Servlet
(),my problem is that where i have to put & how to do pagination?
my code...pagination problem Thanks sir for posting the answer.But i have 2 problems
1.i have created one employee class in that i use getter and setter
pagination problem - JSP-Servlet
(),my problem is that where i have to put & how to do pagination?
my code...pagination problem Thanks sir for posting the answer.But i have 2 problems
1.i have created one employee class in that i use getter and setter
Checkbox pagination problem
Checkbox pagination problem HI .,
Following is my code
test.jsp
<%@page import="java.sql.*"%>
<%@taglib prefix="c" uri="/WEB-INF/c-rt.tld" %>
<%@page import="java.util.HashMap"%>
<%@page import
pagination in php - Ajax pagination in php i want to fetch my data base in view page...i hav done pagination...
i don't want the order....like...
1
2
3
4... the problem in ordering
please give me a solution.. Hi Friend,
You
Pagination
Pagination How to create pagination in jsp with EJB using MS SQL
Pagination
Pagination How to implement pagination in struts using hibernate
pagination
pagination How to set pagination using java script to display data
Pagination
Pagination How to apply pagination in JSP.
Please help
pagination
pagination Simple way for pagination in jsp using java script to display data without send database
Pagination
Pagination Is their plug n play approach for creating pagination?
1) Server side as well as client side
Pagination
Pagination I want to write one where condition in sql query in pagination concept
Pagination
Pagination I want to know how to use pagination in jsp.
I have a list object from that i want to display 3 questions per page
can u help me
pagination
pagination I need to give pagination with where condition (query="select * from qtn where qid='"+replyQuesionId+"'limit "+iPageNo+","+showRows+"" ) like this I want, without where condition it is working but with condition
Pagination with condition using servlet or jsp Pagination with condition using servlet or jsp Hi,
Thanks...")", Then I want perform the pagination based on the string value(I mean pagination with condition). My problem is first time five records will come(I mean 5 records
pagination
pagination I need to give pagination with where condition (query.......
Here is a simple jsp pagination code where we have used mysql database...()) {
totalRows=rs2.getInt("cnt");
}
%>
<html>
<h3>Pagination of JSP
Pagination
=rs2.getInt("cnt");
}
%>
Pagination of JSP page
Terr_Code
Terr_Name
pagination
pagination how can i start pagination in jsp?
Hi Friend,
Try the following code:
<%@ page language="java" %>
<%@ page import...;Pagination of JSP page</h3>
<body>
<form>
<input type="hidden
Pagination
Pagination pagination in jsp
Hi Friend,
Try the following code:
<%@ page language="java" %>
<%@ page import="java.sql.*" %>...()) {
totalRows=rs2.getInt("cnt");
}
%>
<html>
<h3>Pagination of JSP
What's wrong with my pagination code in JSP?
What's wrong with my pagination code in JSP? Dear experts,
I've...;
print("code sample");
JSP Pagination
The given code retrieves...()){
totalRows=rs2.getInt("cnt");
}
%>
<html><h3>Pagination of JSP
Pagination in java Pagination in java How to handle pagination when there are records like say in millions in java? Or do we handle this using SQL? I as asked... far good performance then Java pagination.
Thanks
pagination in jsf pagination in jsf Hi ,
i am implemeting an online exam system , i have placed my questions as an arraylist in my jsp file within tag , but now i want to paginate these questions based on respective questions by clicking
jsp pagination
jsp pagination I want to implement pagination on jsp page Each jsp page having some radio buttons, on click of next previous page selected radio buttons are reset. I want to maintain state of selected radio buttons on previous
JSP Pagination
to be shown, I want to implement Pagination.. Can someone show me a sample code which I could possibly use??
JSP Pagination
pagination.jsp:
<%@ page...");
}
%>
<html><h3>Pagination of JSP page</h3>
<body><
Hibernate Pagination
In this tutorial we will discuss concept of pagination in hibernate
jsf pagination
of pagination. In the given code,we have taken the database table student(rollNo,name,marks...()) {
totalRows=rs2.getInt("cnt");
}
%>
<html>
<h3>Pagination of JSP
Two Pagination in one page
Two Pagination in one page hai friends any one help me.
how do u make two pagination script in same page i'm used some ajax coding one pagination script is working but another pagination is not working please help me urgent
pagination in hibernate with jsp pagination in hibernate with jsp Hi,
plz give me example on pagination .
Hi Friend,
Visit Here
Thanks
Pagination example with html code Pagination example with html code Hi,
could u please provide pagination code with clear cut explanation.
Thanks in advance
pagination - JSP-Servlet
pagination Hi,
could u tell me how i will handle pagination... friend,
Simple pagination in jsp
Simple pagination in JSP...
Simple pagination in jsp
Displaying Records
pagination in jsp - JDBC pagination in jsp Hi,
I have millions of records in my oracle d... in advance...
Hi friend,
This is simple code of pagination.
Simple pagination in jsp
Pagination in PHP code - PHP Pagination in PHP code 3.Pagination in PHP codeIs it possible to get the paging in PHP without database call? How will I show the image instead of numbering? any code that can help
Pagination Using Displaytag Lib Pagination Using Displaytag Lib I am using Struts 1.2 for my web based project.
While using display tag lib in jsp for pagination, is there any substitute of using
As I dont want to be dependent on any site(s).
Please
Pagination - JSP-Servlet
Pagination I want to display only 10 records but my arraylist contains for example about 100 records...
My jsp page should contain 10 records along with the pagination below....
like
prev 1 2 3 4 5 next
I am using
Pagination Example
;
In this section, you will learn how to create pagination in struts 2. For creating pagination in
your application follows the certain steps:
Download...;a href="roseindia/pagination.action">Pagination Example</a></li>
Paging or pagination - Development process
Paging or pagination 1.how to do paging or pagination in jsp using servlets?
I have a 20 records ,i have to show them in 2 pages like pages 1 2...("Starting index is "+startIndex);
%>
Pagination
The Following
pagination in hibernate with jsp pagination in hibernate with jsp Hi,
plz give me example on pagination .
Hi Friend,
We have used MySql database with JSP...>Pagination of JSP page</h3>
<body>
<form>
<input type
dynamic pagination in jsp - JSP-Servlet
dynamic pagination in jsp i am unable to display the data in multiple pages. I am gettting data from the database from the javaBeans to jsp by vectors... but i am unable to displaying them in jsp 15 records per page
store pagination form fields - Struts
store pagination form fields hi,iam working online exams project . my intention is to save data that
has been asnwered by client/student into db table. here iam using pagination for questions to be displayed to client
Hibernate Criteria Pagination
Hibernate Criteria Pagination
You can easily make a pagination based application in Hibernate Criteria. You
need to do the things that set first result...(end);
An example of hibernate criteria pagination is given below
Pagination in jsp using oracle and not sql Pagination in jsp using oracle and not sql I need the code for pagination in jsp using oracle.
I already tried it with rownum between instead... Pagination using Mysql database
<%@ page language="java" %>
<%@ page
pagination in JSP - JSP-Interview Questions pagination in JSP Hi! Everybody..
I am new to JSP.
I am doing project using JSP.
Everything is OK.
When i am displaying the data from ResultSet. I am getting bulk data in the same page.
Ex:ExecuteQuery("select * from