<%@ 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" %>

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

<html>
 <head>
 <title>회원 목록</title>
 <style>
 table {
    width: 80%;
    border: 2px solid #444444;
    border-collapse: collapse;
  }
  th, td {
    border: 1.5px solid #444444;
    padding: 9px;
  }
  #gap {
    margin: 9px;
  }
 </style>
 </head>
 <body>  
  <div align="center" style="font-size:25px; font-weight:bold;" id="gap">회원 목록</div>
  
<table width="620" align="center">

<tr>
<th bgcolor="#E6E6E6">아이디</th>
<th bgcolor="#E6E6E6">패스워드</th>
<th bgcolor="#E6E6E6">이름</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","20182263","980629");
		PreparedStatement pstmt=conn.prepareStatement("select * from member_1") ;
		rs=pstmt.executeQuery();
		
		while(rs.next()){
			String id=rs.getString("id");
			String password=rs.getString("password");
			String name=rs.getString("name");
			 		
			%>
			<tr>
			<td><%= id %></td>
			<td><%= password %></td>
			<td><%= name %></td>
			 			
			</tr>
						
		<% }
}catch(Exception e){ 
		e.printStackTrace();
}
%>
</table>

  
</body>
</html>
