<%@ 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>
 </head>
 <body bgcolor="F5F5DC">  
	<h1 align="center"> <A href="http://localhost:8080/EXEX/main2.jsp" > J  S  P </A> </h1> <p>
	<h2 align="center"> 회원목록 페이지 입니다. </h2> <p><p>
	<hr>
	<table border=1 align=center>
		<tr>
			<th align="center" width="100" height="20">아이디</th>
			<th align="center" width="100" height="20">이름</th>
			<th align="center" width="100" height="20">성별</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","20162486","970409");
		PreparedStatement pstmt=conn.prepareStatement("select * from MEMBER_2A") ;
		rs=pstmt.executeQuery();
		
		while(rs.next()){
			String id=rs.getString("id");
			String name=rs.getString("name");
			String gender=rs.getString("gender");
			 		
			%>
			<tr>
			<td align="center" width="100" height="20"><%= id %></td>
			<td align="center" width="100" height="20"><%= name %></td>
			<td align="center" width="100" height="20"><%= gender %></td>			
			</tr>
						
		    <% }
}catch(Exception e){ 
		e.printStackTrace();
}
%>

</table>
<hr>
<p align="center">
<a href="http://localhost:8080/EXEX/loginForm.jsp">로그인</a>&nbsp;&nbsp;
<a href="http://localhost:8080/EXEX/inputForm.jsp">회원가입</a>
<p>
</body>
</html>
