⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 showbooks.jsp

📁 在网上书店买书
💻 JSP
字号:
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ page import="java.sql.*" %>
<%@ page import="Model.DataOperation" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>E-Book Store</title>
</head>
<body style="text-align: center">
<jsp:useBean id="DataOperation" class="Model.DataOperation" scope="page"/>
<table width="604" height="240">

<%
Connection con=DataOperation.getConnection();
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select * from Book");

while(rs.next()){
%>
<tr>
    <td bgcolor="#0099CC" width="315">
        <p align="center"><b>
            <font face="Tahoma" color="#008000">
                <br>
                <br>
                book title
                <br>
                <br>
    </font></b></td>
    <td bgcolor="#0099CC">
        <font color="#008000">
            <%
            String title=rs.getString("Title");
            out.println(title);
            %>
        </font>
    </td>
</tr>
<tr>
    <td width="315" height="26">
        <p align="center"><font face="Tahoma">Price </font>
    </td>
    <td height="26">
        <%
        double price=rs.getDouble("price");
        out.println(price);
        %>
    </td>
</tr>
<tr>
    <td width="315" height="44">
        <p align="center"><font face="Tahoma">Date of 
        Publication </font>
    </td>
    <td height="44">
        <%
        Date date=rs.getDate("PublicationDate");
        out.println(date);
        %>
    </td>
</tr>
<tr>
<td width="315" height="75">
    <form action="ShowDetals.jsp" method=post>
        <p align="center">
            <font size="3">
                <input type="hidden" value=<%=rs.getString("ISBN")%>  name="ISBN">
            <input type="submit" value="detals"></font>
        </p>
    </form>
    </p>
</td>

<td height="75">
    <form method="post" action="BuyController">
        
        <p align="center"><font size="3">
                
            <input type="submit" value="Buy"></font>
            <font size="3">
                <input type="hidden" name="image" value=<%=rs.getString("image")%>>
                    <input type="hidden" name="ISBN" value=<%=rs.getString("ISBN")%>>
                    <input type="hidden" name="Price"value=<%=rs.getDouble("price")%> >
                    <input type="hidden" name="Title"value=<%=rs.getString("Title")%> >
                    
            </font></p>
        
    </form> </p>
</td>
</tr>
<%}%>
<hr/>
</table>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -