-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaviewall.jsp
More file actions
38 lines (34 loc) · 1.51 KB
/
Copy pathaviewall.jsp
File metadata and controls
38 lines (34 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%@ page import="java.sql.*"%>
<%
String n = request.getParameter("val");
if (n.length() > 0) {
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe", "system",
"shonu123");
PreparedStatement ps = con.prepareStatement("select * from payregister where id ='" + n + "'");
ResultSet rs = ps.executeQuery();
out.print("<br>");
out.print("<table border='5' cellspacing=5 cellpadding=2>");
out.print(
"<tr><td><a href='#' name='ID' onmouseover='javascript:viewAllInfo(this.name)'><B>ID</B></a></td><td><B>User name</B></td><td><B>Password</B></td><td><B>Date of joining</B></td><td><B>Date of Birth</B></td><td><B>Salary</B></td><td><B>Remove</B></td></tr>");
while (rs.next()) {
out.print("<tr><td><a href='#' name='" + rs.getString(1)
+ "' onmouseover='javascript:viewAllInfo(this.name)'>" + rs.getString(1) + "</a></td>");
out.print("<td>" + rs.getString(2) + "</td>");
out.print("<td>" + rs.getString(3) + "</td>");
out.print("<td>" + rs.getString(5) + "</td>");
out.print("<td>" + rs.getString(6) + "</td>");
out.print("<td>" + rs.getString(7) + "</td>");
out.print("<td><a href='aremove.jsp?val=" + rs.getString(1) + "' name='" + rs.getString(1)
+ "'>Delete</a></td>");
out.print("</tr>");
}
out.print("</table>");
con.close();
} catch (Exception e) {
e.printStackTrace();
}
}
%>