<%@ 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>
<style type="text/css">
table, tr, td {
border : 2px; solid : red;
} table {	
width : 60%;
height : 100px;
margin : auto;
text-align : center;
}
</style>
</head>
</form>
<body>
<center><img src="image\list.png" width="100" height="100" border="0"></center>
<center><h2> 회원목록</h2></center>
<table border=1>

<tr>
<th>이름</th>
<th>아이디</th>
<th>패스워드</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","20162496","980216");
PreparedStatement pstmt=conn.prepareStatement("select * from MEMBER_TABLE") ;
rs=pstmt.executeQuery();
		
while(rs.next()){
String name=rs.getString("name");
String id=rs.getString("id");
String passwd=rs.getString("passwd");
			 		
%>
<tr>
<td><%= name %></td>
<td><%= id %></td>
<td><%= passwd %></td>
			 			
</tr>
						
<% }
}catch(Exception e){ 
e.printStackTrace();
}
%>
</table>
<p>
<form method="post" action="main.jsp">
<center><input type="submit" value="메인으로 가기" style="font-face : MD개성체 ; "></center>
</p>
</form>
</body>
</html>