독도 광고 모금 캠페인

특별한딸기이야기

블로그 이미지
딸기다운 사이버 공간을 만들고 싶어하는 특별한 딸기의 블로그입니다.
by 특별한녀석
  • 7883Total hit
  • 12Today hit
  • 35Yesterday hit

최근에 달린 레몬펜 쪽지

Statistics Graph

<%@ page contentType = "text/html;charset=euc-kr" %>
<%@ page import = "java.sql.*" %>
<html>
 <head>
  <title>
   테이블의 레코드를 화면에 표시하는 예제
  </title>
 </head>
 <body>
  <h2>
   member1 테이블의 레코드를 화면에 표시하는 예제
  </h2>
  <table width = "550" border = "1">
   <tr>
    <td width = "100">
     아이디
    </td>
    <td width = "100">
     패스워드
    </td>
    <td width = "100">
     이름
    </td>
    <td width = "250">
     가입일자
    </td>
   </tr>
   <%
    Connection con = null;
    PreparedStatement pstmt = null;
    ResultSet rs = null;
   
    try
    {
     Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
     con = DriverManager.getConnection("jdbc:sqlserver://ants.mju.ac.kr:1433", "webp_32", "a123a123");
     
     String sql = "select * from Table_1";
     
     pstmt = con.prepareStatement(sql);
     rs = pstmt.executeQuery();
     
     while(rs.next())
     {
      String id = rs.getString("ID");
      String pw = rs.getString("PW");
      String name = rs.getString("Name");
   %>
    <tr>
     <td width = "100">
      <%= id%>
     </td>
     <td width = "100">
      <%= pw%>
     </td>
     <td width = "100">
      <%= name%>
     </td>
    </tr>
   <%
     }
    }
    catch(Exception e)
    {
     e.printStackTrace();
    }
    finally
    {
     if(rs != null)
     {
      try
      {
       rs.close();
      }
      catch(SQLException sqle)
      {
      }
     }
     if(pstmt != null)
     {
      try
      {
       pstmt.close();
      }
      catch(SQLException sqle)
      {
      }
     }
     if(con != null)
     {
      try
      {
       con.close();
      }
      catch(SQLException sqle)
      {
      }
     }
    }
   %>
  </table>
 </body>
</html>
TRACKBACK 0 AND COMMENT 0

ARTICLE CATEGORY

딸기 이야기 (241)
딸기의 혼잣말 (55)
딸기 호감 사이트 (2)
딸기의 사진 (16)
딸기 리뷰 (15)
딸기 공부방 (105)
딸기 자료실 (48)

CALENDAR

«   2008/08   »
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            

ARCHIVE