member_list.jsp
페이지 정보
본문
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.sql.*"%>
<%
if ((session.getAttribute("id")==null) || (!((String)session.getAttribute("id")).equals("admin"))) {
out.println("<script>");
out.println("location.href='loginForm.jsp'");
out.println("</script>");
}
Class.forName("com.mysql.jdbc.Driver");
String url="jdbc:mysql://localhost:3306/test?serverTimezone=UTC";
String user="root";
String password="1111";
Connection conn=null;
PreparedStatement pstmt=null;
ResultSet rs=null;
try {
conn=DriverManager.getConnection(url, user, password);
pstmt=conn.prepareStatement("select * from member2");
rs=pstmt.executeQuery();
}catch(Exception e){
e.printStackTrace();
}
%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>회원관리 시스템 관리자모드(회원 정보 보기)</title>
<style>
table{
margin : auto;
width : 400px;
border : 1px solid gray;
text-align: center;
}
</style>
</head>
<body>
<table>
<tr>
<td colspan="2" class="td_title">회원 목록</td>
</tr>
<%while(rs.next()){ %>
<tr>
<td><a href="member_info.jsp?id=<%=rs.getString("id") %>"><%=rs.getString("id") %></a></td>
<td><a href="member_delete.jsp?id=<%=rs.getString("id") %>">삭제</a></td>
</tr>
<%} %>
</table>
<%
rs.close();
pstmt.close();
conn.close();
%>
</body>
</html>
- 이전글main.jsp 21.07.15
- 다음글member_info.jsp 21.07.15
댓글목록
등록된 댓글이 없습니다.