Servlet+oracle MVC 架構 搭建簡易購物車web項目---資料庫設計

來源:互聯網
上載者:User

標籤:

Servlet+oracle MVC 架構 搭建簡易購物車web項目

主要實現以下功能:

1.使用者登入,從資料庫驗證使用者的合法性。

2.購物大廳,從資料庫取出商品進行展示。

3.在購物大廳可以點擊購買商品,跳到我的購物車介面。

4.在我的購物車頁面,可以更新商品數量,並能夠計算商品總價。可以刪除商品。可以提交訂單。

5.提交訂單以後,進入訂單頁面,展示個人資訊和訂單資訊

 6.再次提交訂單以後,給使用者寄送電子郵件,提醒使用者。


資料庫設計

使用者表create table users(id number primary key,name varchar2(50) not null,pwd varchar2(50) not null,email varchar2(100) not null,tel varchar2(20) not null,grade number(2) default 1 not null);商品表create table book(id number primary key,name varchar2(50) not null,author varchar2(100) not null,publishHouse varchar2(100) not null,price number not null,nums number default 1000 not null);測試資料(使用者)insert into users values(110,'wxh','wxh','[email protected]','455',1);commit;自增長create sequence book_seqstart with 1increment by 1minvalue 1maxvalue 9999999nocyclenocache;測試資料(商品)insert into book values(book_seq.nextval,'jsp應用開發詳解','小風','電子工業出版社',59,400);insert into book values(book_seq.nextval,'JAVA WEB 開發','小黃','電子工業出版社',43,734);<pre name="code" class="sql">commit;

訂單表create table orders(id number primary key,--訂單的編號userId number  references users(id),--下訂單的使用者編號totalPrice number default 0 not null,--該訂單的總價格orderDate date default sysdate not null --該訂單的時間);訂單細節表create table orderItem(id number primary key, --增長的編號ordersId number references orders(id),bookId number references book(id),--書號是多少bookNum number default 0 not null --商品的數量);自增長1create sequence order_seqstart with 1increment by 1minvalue 1maxvalue 9999999nocyclenocache;自增長1create sequence orderitem_seqstart with 1increment by 1minvalue 1maxvalue 9999999nocyclenocache;






————摘自《韓順平細說jsp》

Servlet+oracle MVC 架構 搭建簡易購物車web項目---資料庫設計

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.