<%@ 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">
#main_menu {

	font-size:12px;
	color:black;
	background-color:#FFE650;
	margin-top:15px;
	padding:12px;
	text-align:center;
}
#main_menu li{
	padding:0 20px 0 20px;
	display:inline;
}

</style>
 </head>
 <body bgcolor="#FF8E99"> 
 <ul id="main_menu">
<li><a href="http://localhost:8080/member12/abc/list.jsp">전체회원 목록보기</a></li>
<li><a href="http://localhost:8080/member12/abc/editForm.jsp">회원정보 수정</a></li>
<li><a href="http://localhost:8080/member12/abc/deleteForm.jsp">회원탈퇴</a></li>
<li><a href="http://localhost:8080/member12/abc/Logout.jsp"><input type="submit" value="로그아웃"></a></li> 
</ul>
<center>
<form id="a">
<h2>회원목록</h2>
<table border=1>
<tr>
<th>아이디</th>
<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","20182244","990621");
		PreparedStatement pstmt=conn.prepareStatement("select * from MEMBER_2A") ;
		rs=pstmt.executeQuery();
		
		while(rs.next()){
			String id=rs.getString("id");
			String password=rs.getString("password");
			String name=rs.getString("name");
			String post=rs.getString("post");
			 		
			%>
			<tr>
			<td><%= id %></td>
			<td><%= password %></td>
			<td><%= name %></td>
			<td><%= post %></td>
			</tr>
						
		<% }
}catch(Exception e){ 
		e.printStackTrace();
}
%>
</table>
</form>
<a href="http://localhost:8080/member12/abc/main.jsp">메인으로 </a>
</center>

  
</body>
</html>