goodsID = rs.getInt(1); goodsName = rs.getString(2); introduce = rs.getString(3); nowprice = rs.getFloat(4); picture = rs.getString(5); %>
(元) |
if (username != null && username != \ %> |
conn.close(); %>
(4)特价书页面的设计: 该页面效果如图 26 所示:
图 3-11 特价书sale.jsp的效果图
特价书sale.jsp关键代码如下:
<%@ page contentType=\ import=\<%@ page import=\<% connDB conn = new connDB(); String username = (String) session.getAttribute(\ ResultSet rs = conn .executeQuery(\sale=1 order by GoodsName\ int goodsID = -1; String goodsName = \ String introduce = \ float price = (float) 0.0; float nowprice = (float) 0.0; String picture = \%>
price = rs.getFloat(4); nowprice = rs.getFloat(5); picture = rs.getString(6); %>
|
conn.close(); %>
(5)图书的详细信息页面设计 该页面效果如图 26 所示:
图 3-12图书的详细信息good_detail.jsp的效果图
图书的详细信息页面设计good_detail.jsp 关键代码如下:
<%@ page contentType=\<%@ page import=\<% connDB conn = new connDB(); String username = (String) session.getAttribute(\ int ID = -1; ID = Integer.parseInt(request.getParameter(\ if (ID > 0) { ResultSet rs = conn .executeQuery(\ID,GoodsName,Introduce,nowprice,picture from tb_goods where ID=\+ ID); int goodsID = -1; String goodsName = \ String introduce = \ float nowprice = (float) 0.0; String picture = \ if (rs.next()) { goodsID = rs.getInt(1); goodsName = rs.getString(2); introduce = rs.getString(3); nowprice = rs.getFloat(4); picture = rs.getString(5); }