소스

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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<%@ page import="java.sql.*" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%!
    private Connection conn;
    private Statement stmt;
    private ResultSet rs;
%>
<%
    Class.forName("oracle.jdbc.driver.OracleDriver");
    conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe", "scott", "tiger");
    stmt = conn.createStatement();
    rs = stmt.executeQuery("select * from guest");
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Insert title here</title>
    <style type="text/css">
        *{
            margin: 0px;
            padding: 0px;        
        }
        #header,#footer{
            background-color: #ccc;
            height: 80px;
        }
        #header>h1{
            text-align: center;
        }
        table{
            width: 100%;
        }
        table td:nth-child(1){
            width: 20%;
        }
        table td:nth-child(2){
            width: 30%;
        }
        .row{
            border-bottom: red solid 1px;
        }
        .row>div{
            display: inline-block;
            width: 25%;
        }
        a{
            text-decoration: none;
        }
        #footer li{
            display: inline-block;
            width: 22%;
            margin: 0px 3px;
        }
        #footer a{
            display: inline-block;
            background-color: #aaa;
            width: 100%;
            height: 80px;
            text-align: center;
            line-height: 80px;
        }
    </style>
</head>
<body>
    <div id="header">
        <h1>app 화면</h1>
    </div>
    <div id="content">
        <div id="table">
            <div class="row">
                <table>
                    <tr>
                        <td rowspan="2">사번</td>
                        <td rowspan="2">이름</td>
                        <td>날짜</td>
                    </tr>
                    <tr>
                        <td>금액</td>
                    </tr>
                </table>
            </div>
        </div>
        <% while(rs.next()){ %>
        
        <a href="#?sabun=<%=rs.getInt("sabun") %>">
         <div class="row">
            <div class = "col"><%=rs.getInt("sabun") %></div>
            <div class = "col"><%=rs.getString("name") %></div>
            <div class = "col"><%=rs.getDate("nalja") %></div>
            <div class = "col"><%=rs.getInt("pay") %></div>
         </div>
         </a>
        <% } %>
    </div>
    <div id="footer">
        <ul>
            <li><a href="#">HOME</a></li>
            <li><a href="#">menu1</a></li>
            <li><a href="#">menu2</a></li>
            <li><a href="#">BACK</a></li>
        </ul>
    </div>
</body>
</html>
cs

결과


+ Recent posts