-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathandroidhome.jsp
More file actions
52 lines (44 loc) · 1.42 KB
/
androidhome.jsp
File metadata and controls
52 lines (44 loc) · 1.42 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<%@page import ="java.sql.*"%>
<%@page import ="org.json.*"%>
<%@ include file="common/connection.jsp" %>
<%!
PreparedStatement stmt;
ResultSet rs;
String error;
%>
<%
String user=request.getParameter("name");
JSONObject obj=new JSONObject();
try
{
stmt=con.prepareStatement("select * from newuser where userid=(?)");
stmt.setString(1, user);
rs=stmt.executeQuery();
while(rs.next())
{
String temp_user_name=rs.getString(2);
if(temp_user_name.compareTo(user)==0)
{
obj.put("name",rs.getString(1));
obj.put("userid",rs.getString(2));
obj.put("gender",rs.getString(4));
obj.put("email",rs.getString(5));
obj.put("phone",rs.getString(6));
}
}
rs.close();
stmt.close();
con.close();
}
catch(SQLException e)
{
error=e.getMessage();
out.print("<p>"+error+"</p>");
}
catch(Exception e)
{
error +=e.getMessage();
out.print("<p>"+error+"</p>");
}
out.println(obj);
%>