当前位置:编程学习 > JSP >>

求JSP高手解决 必有重谢

一、 总体要求 实现B2C商城的简单功能。 包括:注册、登录、商品展示、购物车、生成订单(此功能模块为可选模块)。 二、 流程 商城首页(商品展示product.jsp)——》用户注册(register.html)——》用户登录(login.html)——》查看商品信息(product.jsp)——》单个商品详细信息(details.jsp)——》添加商品到购物车(cart.jsp)——》维护购物车(showCart.jsp)——》确定购买 三、 数据库要求 数据库名shop 表名: user(用户信息) product(商品信息) order(订单信息) 备注:如果选做“生成订单”功能,则需要order表,否则不需要。
其他:我可以解决你的问题。怎么酬谢 重谢是多重,分数就算了,8care 我只知道asp 这个用百度分数换比较难,我手上有,你可以百度hi联系我 use master
if exists(select * from sysdatabases where name='Bookshop')
	drop database Bookshop
go
create database Bookshop
go
use Bookshop;
--出版社信息
create table publisher
(
	publisherId int primary key identity(1,1),
	publisherName varchar(30) not null
)
go

--书籍类型 select * from  bookType
create table bookType
(
	bookTypeId int primary key identity(1,1),
	bookTypeName varchar(50) not null,
	bookTypeParentId int not null default(0)
)

--书籍及库存信息,没有分开,理想状态应该分开 select * from bookType where bookTypeParentId='2'
create table book
(
	bookId int primary key identity(1,1),
	bookName varchar(100) not null,--书名
	bookAuthor varchar(50) not null,--作者
	bookPublisher int references publisher(publisherId),--出版社
	bookPublishDate smalldatetime not null,--出版日期
	bookPrintDate smalldatetime not null,--印刷日期
	bookCharacterCount int not null,--字数
	bookPublishVersion int default(1),--版次
	bookPrintVersion int default(1),--印次
	bookPageCount int ,--页数
	bookSize varchar(10),--开本
	bookISBN varchar(20),--ISBN
	bookImage varchar(500),--封面图片路径
	bookCount int not null default(0),--库存数量
	bookPrice money not null,--定价
	bookDiscount real not null default(1),--折扣,0.5表示5折
	bookDigist varchar(4000) not null,--摘要
	firstBookTypeId int references bookType(bookTypeId),--类型1
	secondBookTypeId int references bookType(bookTypeId)--类型2
)
go


--用户表,和订单、评论、收藏等对应
create table [user]
(
	userId int primary key identity(1,1),
	userName varchar(30) not null,
	userPass varchar(20) not null,
	userScore int default(10),
	userFace varchar(400) ,--头像的文件路径
	userCommentCount int default(0),
	userEmail varchar(30) ,
	userGender varchar(2) default('男'),
	userAge int
	
)
go

--账号表,和用户之间的一对多关系
create table account
(
	accountId int primary key identity(1,1),
	accountBalance money not null default(0),
	accountUserId int references [user](userId),
	accountTransPwd varchar(20) not null--交易密码
)
go
--书籍评论
create table comment
(
	commentId int primary key identity(1,1),
	commentUserId int references [user](userId) ,
	commentBookId int references book(bookId),
	commentTitle varchar(60) not null,
	commentText varchar(4000) not null,
	commentDate datetime default(getdate())
)
go
select * from [order]
--订单
create table [order]
(
	orderId int primary key identity(1,1),
	orderUserId int references [user](userId),
	orderDate datetime default(getdate()),
	orderReciveAddress varchar(500) not null,
	orderReciveUserName varchar(20) not null,
	orderRecivePostcode varchar(10),
	orderReciveMobile1 varchar(20),
	orderReciveMobile2 varchar(20)
	
)
go
--订单详情
create table orderDetail
(
	orderDetailId int primary key identity(1,1),
	orderDetailOrderId int references [order](orderId),
	orderDetailBookId int references book(bookId),
	orderDetailBookPrice money ,
	orderDetailBookCount int default(1)
	
)
go

--后台管理账户
create table admin
(
	adminId int primary key identity(1,1),
	adminName varchar(30) not null,
	adminPass varchar(20) not null,
	adminLevel int not null
)
go
insert into admin (adminName ,adminPass, adminLevel) values('wuhaifeng','123456','1')
--收藏
create table favourite
(
	favouriteId int primary key identity(1,1),
	favouriteBookId int references book(bookId),
	favouriteUserId int references [user](userId)
)

--新闻公告
create table news
(
	newsId int primary key identity(1,1),
	newsTitle varchar(200) not null,
	newsContent varchar(max) not null,
	newsDate datetime default(getdate())
)

--以下为省市级联数据库
--省级   provincial  
create table provincial
(
  provincialID int  primary key ,
  provincialName varchar(50)
)
  
insert into provincial values(1,'北京市');
insert into provincial values(2,'天津市');
insert into provincial values(3,'上海市');
insert into provincial values(4,'重庆市');
insert into provincial values(5,'河北省');
insert into provincial values(6,'山西省');
insert into provincial values(7,'台湾省');
insert into provincial values(8,'辽宁省');
insert into provincial values(9,'吉林省');
insert into provincial values(10,'黑龙江省');
insert into provincial values(11,'江苏省');
insert into provincial values(12,'浙江省');
insert into provincial values(13,'安徽省');
insert into provincial values(14,'福建省');
insert into provincial values(15,'江西省');
insert into provincial values(16,'山东省');
insert into provincial values(17,'河南省');
insert into provincial values(18,'湖北省');
insert into provincial values(19,'湖南省');
insert into provincial values(20,'广东省');
insert into provincial values(21,'甘肃省');
insert into provincial values(22,'四川省');
insert into provincial values(23,'贵州省');
insert into provincial values(24,'海南省');
insert into provincial values(25,'云南省');
insert into provincial values(26,'青海省');
insert into provincial values(27,'陕西省');
insert into provincial values(28,'广西壮族自治区');
insert into provincial values(29,'易做图自治区');
insert into provincial values(30,'宁夏易做图自治区');
insert into provincial values(31,'新疆易做图尔自治区');
insert into provincial values(32,'内蒙古自治区');
insert into provincial values(33,'澳门特别行政区');
insert into provincial values(34,'香港特别行政区');
select provincialID,provincialName from provincial;
   
--城市   city
create table city
(
cityID int primary key not null,
cityName varchar(50) not null,
provincialID int not null
)

alter table city add constraint FK_pro_city_provincialID foreign key (provincialID)
      references provincial (provincialID);
     
----------------------------------------------------------------------------------------------------------------------------------------  
---------------------------------------------------------------  
- 500块RMB

上一个:JSP中如何将表单输入参数封装到JavaBean中?
下一个:jsp标签<c:if>是怎以用的?

CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,