<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.sql.*"%>
<%
	request.setCharacterEncoding("utf-8");
%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>리스트</title>
<style>
body {
	background-image: url("../image/background.jpg");
	background-repeat: no-repeat;
	background-size: 100%;
}
</style>

</head>
<body>
	<div class="list">
		<style>
.list {
	position: absolute;
	top: 38%;
	left: 50%;
	transform: translate(-50%, -50%);
}

table, tr, td {
	padding: 15px;
	border: 1px solid #000000;
	border-collapse: collapse;
	text-align: center;
}

thead {
	text-align: center;
	font-weight: bold;
}
</style>
		<h2>회원 목록</h2>
		<hr>
		<p>
		<fieldset
			style="padding: 30px; border-color: #A0D9E2; text-align: center;">
			<legend>
				<b>리스트</b>
			</legend>
			<table border="1">
				<tr>
					<th bgcolor="#D4F4FA">아이디</th>
					<th bgcolor="#D4F4FA">패스워드</th>
					<th bgcolor="#D4F4FA">이름</th>
					<th bgcolor="#D4F4FA">생년월일</th>
					<th bgcolor="#D4F4FA">성별</th>
					<th bgcolor="#D4F4FA">이메일</th>
					<th bgcolor="#D4F4FA">전화번호</th>
				</tr>
				<%
					ResultSet rs = null;
					try {
						Class.forName("oracle.jdbc.driver.OracleDriver");
						Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@168.126.146.45:1521:orcl", "20152488",
								"960504");
						PreparedStatement pstmt = conn.prepareStatement("select * from membership");
						rs = pstmt.executeQuery();

						while (rs.next()) {
							String id = rs.getString("id");
							String password = rs.getString("password");
							String name = rs.getString("name");
							String birth = rs.getString("birth");
							String gender = rs.getString("gender");
							String email = rs.getString("email");
							String phone = rs.getString("phone");
				%>
				<tr>
					<td><%=id%></td>
					<td><%=password%></td>
					<td><%=name%></td>
					<td><%=birth%></td>
					<td><%=gender%></td>
					<td><%=email%></td>
					<td><%=phone%></td>
				</tr>
				<%
					}
					} catch (Exception e) {
						e.printStackTrace();
					}
				%>
			</table>
			<br>
			<p>
				<A href="http://localhost:8080/jsp_final_A_20152488/member/main.jsp">메인화면가기</A>
	</div>
</body>
</html>