-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathviewall.jsp
More file actions
34 lines (31 loc) · 1.24 KB
/
Copy pathviewall.jsp
File metadata and controls
34 lines (31 loc) · 1.24 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
<%@ 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 student where id ='" + n + "'");
//ps.setString(1,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>Total Fee</B></td><td><B>Paid Amount</B></td><td><B>Balance</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(6) + "</td>");
out.print("<td>" + rs.getString(7) + "</td>");
out.print("<td>" + rs.getString(8) + "</td>");
out.print("</tr>");
}
out.print("</table>");
con.close();
} catch (Exception e) {
e.printStackTrace();
}
} //end of if
%>