-
Notifications
You must be signed in to change notification settings - Fork 43
/
index_1.jsp
124 lines (92 loc) · 3.47 KB
/
index_1.jsp
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Global Banking ..</title>
<link href="style.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
function ctck()
{
var sds = document.getElementById("dum");
}
</script>
</head>
<body>
<div id="top_links">
<div id="header">
<h1>APANA - BANK<span class="style1"></span></h1>
<h2>ExtraOrdinary Service</h2>
<A href="index.html"><IMG SRC="images/home1.gif"></IMG></A>
</div>
<div id="navigation">
<ul>
<li><a href="create.html">NEW ACCOUNT</a></li>
<li><a href="balance1.jsp">BALANCE</a></li>
<li><a href="deposit1.jsp">DEPOSIT</a></li>
<li><a href="withdraw1.jsp">WITHDRAW</a></li>
<li><a href="transfer1.jsp">TRANSFER</a></li>
<li><a href="closeac1.jsp">CLOSE A/C</a></li>
<li><a href="about.jsp">Contact Us</a></li>
</ul>
</div>
<table style="width:897px; background:#FFFFFF; margin:0 auto;">
<tr >
<td width="300" valign="top" style="border-right:#666666 1px dotted;">
<div id="services"><h1>Services</h1><br>
<ul>
<li><a href="#">www.javatpoint.com</a></li>
<li><a href="#">www.javacstpoint.com </a></li>
<li><a href="#">www.javatpoint.com/forum.jsp</a></li>
</ul>
</div>
</td>
<td width="1200" valign="top">
<%
%>
<table><%
try {
Connection con1=GetCon.getCon();
//PreparedStatement ps1=con1.prepareStatement("Select max(accountno) from newaccount");
PreparedStatement ps1=con1.prepareStatement("Select max(accountno) from newaccount");
ResultSet rs1=ps1.executeQuery();
while(rs1.next()){
int accountno=rs1.getInt(1);
request.setAttribute("accountno",accountno);
}
Integer accountno=(Integer)request.getAttribute("accountno");
Connection con=GetCon.getCon();
PreparedStatement ps=con.prepareStatement("Select * from NEWACCOUNT where accountno='"+accountno+"'");
// ps.setInt(1,accountno);
ResultSet rs=ps.executeQuery();
out.print("<table align='left' cellspacing='5' cellpadding='5'>");
out.print("<tr><th>ACCOUNT NO</th><th>USERNAME</th><th>PASSWORD</th><th>AMOUNT</th><th>ADDRESS</th><th>PHONE</th></tr>");
while(rs.next()){
session.setAttribute("accountno",accountno);
System.out.print(accountno);
out.print("<tr>");
out.print("<td>" + rs.getInt(1) + "</td>");
out.print("<td>" + rs.getString(2) + "</td>");
out.print("<td>" + rs.getString(3) + "</td>");
out.print("<td>" + rs.getInt(5) + "</td>");
out.print("<td>" + rs.getString(6) + "</td>");
out.print("<td>" + rs.getLong(7) + "</td>");
//out.print("<td><a href='DeleteServlet' >Delete</a></td>");
out.print("</tr>");
}
out.print("</table>");
/*out.print("<table align='right'width='40%'>");
out.print("<tr><td><a href='Compose.html'>COMPOSE</a></td></tr>");
out.print("<tr><td><a href='InboxServlet'>INBOX</a></td></tr>");
out.print("<tr><td><a href='LogoutServlet'>LOGOUT</a></td></tr>");
//out.print("<tr><td><a href='DeleteServlet'>Delete</a></td></tr>");
out.print("</table>");*/
} catch (SQLException e) {
e.printStackTrace();
}
%></table><%
%>
</table>
<%@ page import="java.sql.*"%>
<%@ page import="java.io.*" %>
<%@ page import="javax.servlet.*"%>
<%@ page import="g.*" %>