<%@ page contentType="text/html; charset=utf-8" %>
<%@ include file="/adress/lib/db_config.jsp"%>
<%
ResultSet rs = null;
Connection conn = null;
Statement stmt = null;
PreparedStatement pstt = null;
ArrayList<HashMap<String, String>> list = new ArrayList<HashMap<String, String>>();
int total_count = 0;
try{
Class.forName("oracle.jdbc.driver.OracleDriver");
conn = DriverManager.getConnection(db_con_full,db_id,db_pw);
//jdbc:oracle:thin@오라클 서버명 주소:1521:전역변수이름(sid),"user","ps")
stmt = conn.createStatement();
String where = "";
String order = "";
String filed = " I_IDX, VC_NAME, VC_TEL, VC_ADRESS01, VC_ADRESS02, VC_ETC, DT_REGDATE, VC_REGIP, DT_UPDATE, VC_UPIP ";
String sql = " SELECT " + filed + " FROM ADRESS " + where + order ;
//pstt = conn.prepareStatement(sql);
//rs = pstt.executeUpdate();
rs = stmt.executeQuery(sql);
int data01 = 0;
while(rs.next()){
HashMap<String,String> sidmap = new HashMap<String,String>();
sidmap.put("i_idx", getStr(rs.getString("I_IDX")));
sidmap.put("vc_name", getStr(rs.getString("VC_NAME")));
sidmap.put("vc_tel", getStr(rs.getString("VC_TEL")));
sidmap.put("vc_adress01", getStr(rs.getString("VC_ADRESS01")));
sidmap.put("vc_adress02", getStr(rs.getString("VC_ADRESS02")));
sidmap.put("vc_etc", getStr(rs.getString("VC_ETC")));
sidmap.put("dt_regdate", getStr(rs.getString("DT_REGDATE")));
sidmap.put("vc_regip", getStr(rs.getString("VC_REGIP")));
sidmap.put("dt_update", getStr(rs.getString("DT_UPDATE")));
sidmap.put("vc_upip", getStr(rs.getString("VC_UPIP")));
list.add(sidmap);
}
} catch(Exception e2){
out.println("DB 접속 실패 :" + e2.toString());
}finally{
try { rs.close(); } catch(Exception e) {}
try { stmt.close(); } catch(Exception e) {}
try { pstt.close(); } catch(Exception e) {}
try { conn.close(); } catch(Exception e) {}
}
%>
<div><input type="button" value="등록" onclick="goWritePage();" /> </div>
<table cellpadding="0" cellspacing="0" border="0" style="margin:0; padding:0; border-bottom:1px solid #dddddd; border-right:1px solid #dddddd;" width="100%" summary="주소 목록 테이블입니다.">
<caption>주소 목록 테이블입니다.</caption>
<thead>
<tr>
<th class="table_f" width="5%" >no.</th>
<th width="10%" >성명</th>
<th width="15%" >연락처</th>
<th width="50%" >주소</th>
<th width="20%" >등록일</th>
</tr>
</thead>
<tbody>
<% for( int i = 0 ; i < list.size(); i++ ){ %>
<tr>
<td align="center" class="table_f" ><%=list.get(i).get("i_idx")%></td>
<td align="center" ><%=list.get(i).get("vc_name")%></td>
<td align="center" ><%=list.get(i).get("vc_tel")%></td>
<td align="left" ><%=list.get(i).get("vc_adress01")%> <%=list.get(i).get("vc_adress02")%></td>
<td align="center" ><%=list.get(i).get("dt_regdate")%></td>
</tr>
<% } %>
<% if(list.size() == 0){ %>
<tr>
<td colspan="5" align="center`">데이터가 존재하지 않습니다.</td>
</tr>
<% } %>
</tbody>
</table>