%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ page import="com.tools.ChStr" %>
<%@ page import="java.lang.*" %>
<%@ page import="java.sql.ResultSet" %> <%--导入java.sql.ResultSet类 --%>
<%--创建com.tools.ConnDB类的对象 --%>
<%
/* 最新上架商品信息 */
ResultSet rs_new = conn.executeQuery(
"select top 12 t1.ID, t1.GoodsName,t1.price,t1.picture,t2.TypeName "
+"from tb_goods t1,tb_subType t2 where t1.typeID=t2.ID and "
+"t1.newGoods=1 order by t1.INTime desc"); //查询最新上架商品信息
int new_ID=0; //保存最新上架商品的id变量
String new_goodsname=""; //保存最新上架商品名称的变量
float new_nowprice=0; //保存最新上架商品的价格变量
String new_picture=""; //保存最新上架商品的图片变量
String typeName=""; //保存最新上架商品的分类变量
ResultSet rs_sale = conn.executeQuery(
"select top 12 t1.ID, t1.GoodsName,t1.price,t1.nowPrice,t1.picture,t2.TypeName "
+"from tb_goods t1,tb_subType t2 where t1.typeID=t2.ID and t1.sale=1 "
+"order by t1.INTime desc"); //查询打折商品信息
int sale_ID=0; //保存打折商品的id变量
String s_goodsname=""; //保存打折商品名称的变量
float s_nowprice=0; //保存打折商品现在的价格变量
float s_price=0; //保存打折商品的原价格变量
String s_picture=""; //保存打折商品的图片变量
String s_introduce=""; //保存打折商品简介
ResultSet rs_hot =conn
.executeQuery("select top 2 ID,GoodsName,nowprice,picture "
+"from tb_goods order by hit desc"); //查询热门商品信息
int hot_ID = 0; //保存热门商品ID的变量
String hot_goodsName = ""; //保存热门商品名称的变量
float hot_nowprice = 0; //保存热门商品价格的变量
String hot_picture = ""; //保存热门商品图片的变量
%>
首页-魔法集市
<%@ include file="common-header.jsp"%>
热门商品
<%
while(rs_hot.next()){
hot_ID=rs_hot.getInt(1); //获取热门商品id
hot_goodsName=rs_hot.getString(2); //获取热门商品名
hot_nowprice=rs_hot.getFloat(3); //热门商品当前价格
hot_picture=rs_hot.getString(4); //热门商品图片
%>
<%} %>
<%@ include file="common-footer.jsp"%>