-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathid.jsp
More file actions
34 lines (26 loc) · 685 Bytes
/
id.jsp
File metadata and controls
34 lines (26 loc) · 685 Bytes
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 import="java.sql.*" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ include file="db.jsp"%>
<%
String nickname = request.getParameter("nickname");
try {
String sql = "select id from signup where nickname=?";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1, nickname);
rs = pstmt.executeQuery();
if(rs.next()){
String userid = rs.getString("id");
out.print("사용자 id: "+ userid);
} else {
out.print("아이디가 존재하지 않습니다.");
}
}
catch(Exception e){
out.print(e);
} finally {
if (pstmt != null) pstmt.close();
if(conn!= null) conn.close();
if(rs!=null) rs.close();
}
%>