<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.sql.*"%>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.sql.DriverManager" %>
<%@ page import="java.sql.PreparedStatement" %>
<%@ page import="java.sql.ResultSet" %>
<%@ page session="true" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<% request.setCharacterEncoding("utf-8");%>

<html>

<head>
<title>회원 정보 목록</title>
</head>

<body>  

<table width = "450" align = "center" style="border-collapse:collapse;">

<tr>
<td colspan="4">
<div style="font-size:30px; text-align:center; color:#346E73; padding:5px;">회원 정보 목록</div><br>
</td>
</tr>

<tr>
<th style="border:1px solid;">아이디</th>
<th style="border:1px solid;">패스워드</th>
<th style="border:1px solid;">이름</th>
<th style="border:1px solid;">전화번호</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","20182233","991227");
		PreparedStatement pstmt=conn.prepareStatement("select * from o_member") ;
		rs=pstmt.executeQuery();
		
		while(rs.next()){
			String id=rs.getString("id");
			String password=rs.getString("password");
			String name=rs.getString("name");
			String num=rs.getString("num");
			 		
			%>
			
			<tr>
			<td style="border:1px solid; text-align:center;"><%= id %></td>
			<td style="border:1px solid; text-align:center;"><%= password %></td>
			<td style="border:1px solid; text-align:center;"><%= name %></td>
			<td style="border:1px solid; text-align:center;"><%= num %></td>
			</tr>
						
		<% }
}catch(Exception e){ 
		e.printStackTrace();
}
%>

<tr>
<td colspan="4">
<br><div style="font-size:15px; text-align:center; padding:5px;">
<A href="http://localhost:8080/PSY/Fin/main.jsp">클릭시 메인 화면으로 이동합니다.</A>
</div>
</td>
</tr>

</table>

</body>

</html>
