-
Notifications
You must be signed in to change notification settings - Fork 0
/
loginbakcup
61 lines (50 loc) · 1.89 KB
/
loginbakcup
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
<%
try
{
HttpSession sess=request.getSession();
if((sess.getAttribute("login").equals("")))
{
HttpSession sessobj= request.getSession(true);
sessobj.setAttribute("login", "ok");
}
else if((sess.getAttribute("login").equals("ok")))
{
%>
<c:redirect url="signup.jsp"></c:redirect>
<%
}
}
catch(Exception e)
{
}
if(!(name.equals("")))
{
try {
// processRequest(request, response);
Connection conn = com.Database.DB.getConnection();
Statement stmt= conn.createStatement();
String query="select count(*) from emp where Ename='" + name + "' and Job='" + password + "'";
ResultSet rs = stmt.executeQuery (query);
String result="";
while(rs.next())
{
result=rs.getString(1);
}
if(result.equals("1"))
{
%>
<c:redirect url="testajax.jsp"></c:redirect>
<%
}
else
{
%>
<h1>invalid</h1>
<%
} conn.close();
conn = null;
} catch (Exception ex) {
out.println(ex);
}
}
%>