【正文】
人民郵電出版社 2008[6] 夏邦貴等.SQL 數(shù)據(jù)庫(kù)開(kāi)發(fā)經(jīng)典實(shí)例解析 [M].北京:機(jī)工出版社,2006.[7] 丁寶康,董健全.?dāng)?shù)據(jù)庫(kù)實(shí)用教程(第二版)[J].北京:清華大學(xué)出版社,2003.[8] 明日科技,劉彬彬,馬文強(qiáng).Eclipse應(yīng)用開(kāi)發(fā)完全手冊(cè) [M].北京:人民郵電出版社,[9] 思維科技,葉達(dá)峰.Eclipse編程技術(shù)與實(shí)例 [M] .北京:人民郵電出版社,[10] 張海藩.軟件工程導(dǎo)論 [M].北京: 清華大學(xué)出版社, [11] Cay ,Gary Cornell,Java 2核心技術(shù)[M]. 北京:機(jī)械工業(yè)出版社,2000,2967[12] George Reese. JDBC與java數(shù)據(jù)庫(kù)編程[M]. 中國(guó):電力出版社, 2002[13] 附錄 英文原著 (出處: Malcolm Davis. Strutsan opensource MVC implementation [J]. IBM Systems Journal, 2006,44(2):3337.)Struts——an opensource MVC implementationMalcolm DavisThis article introduces Struts, a ModelViewController implementation that uses servlets and JavaServer Pages (JSP) technology. Struts can help you control change in your Web project and promote specialization. Even if you never implement a system with Struts, you may get some ideas for your future servlets and JSP page implementation.IntroductionKids in grade school put HTML pages on the Internet. However, there is a monumental difference between a grade school page and a professionally developed Web site. The page designer (or HTML developer) must understand colors, the customer, product flow, page layout, browser patibility, image creation, JavaScript, and more. Putting a great looking site together takes a lot of work, and most Java developers are more interested in creating a great looking object interface than a user interface. JavaServer Pages (JSP) technology provides the glue between the page designer and the Java developer. If you have worked on a largescale Web application, you understand the term change. ModelViewController (MVC) is a design pattern put together to help control change. MVC decouples interface from business logic and data. Struts is an MVC implementation that uses Servlets and JSP tags, from the J2EE specifications, as part of the implementation. You may never implement a system with Struts, but looking at Struts may give you some ideas on your future Servlets and JSP implementations.ModelViewController (MVC)JSP tags solved only part of our problem. We still have issues with validation, flow control, and updating the state of the application. This is where MVC es to the rescue. MVC helps resolve some of the issues with the single module approach by dividing the problem into three categories: “不積跬步無(wú)以至千里”,這次畢業(yè)設(shè)計(jì)能夠最終順利完成,歸功于各位老師四年間的認(rèn)真教誨和諄諄教導(dǎo),使我能夠很好的掌握專業(yè)知識(shí),并在畢業(yè)設(shè)計(jì)中得以體現(xiàn)。從他那里我學(xué)到了更多的是做事和學(xué)習(xí)的態(tài)度問(wèn)題,以及思考問(wèn)題的全面性和嚴(yán)謹(jǐn)性,這對(duì)以后不論是在學(xué)校還是在工作崗位上都有很大的幫助。致 謝本次畢業(yè)設(shè)計(jì)從選題、設(shè)計(jì)到確定課題經(jīng)歷了較長(zhǎng)時(shí)間。最后采用JDBC的方式連接MySQL數(shù)據(jù)庫(kù),經(jīng)過(guò)幾番調(diào)試后,系統(tǒng)和數(shù)據(jù)庫(kù)成功連上。設(shè)計(jì)時(shí),嚴(yán)格按照軟件工程的思想,從需求分析、可行性分析、總體設(shè)計(jì)、最后到詳細(xì)設(shè)計(jì)。e){ (數(shù)據(jù)庫(kù)連接成功)。Stringmain(String[]public本系統(tǒng)采用的是黑盒測(cè)試。因此,軟件開(kāi)發(fā)人員往往會(huì)選擇那些導(dǎo)致程序失敗概率小的測(cè)試數(shù)據(jù)去測(cè)試軟件。 }第7章 系統(tǒng)測(cè)試及結(jié)果分析 測(cè)試綜述為了確保本系統(tǒng)的質(zhì)量和可靠性,要對(duì)系統(tǒng)進(jìn)行全面的測(cè)試和調(diào)試,主要是軟件測(cè)試和數(shù)據(jù)庫(kù)測(cè)試,下面分別對(duì)它們進(jìn)行了介紹。 public Integer getId() {return id。 } public void setProduct_id(int productId) {product_id = productId。 private int product_id。} (productlist, productList)。 productList = (product3)。 productList = (product2)。 productList = (product)。 switch (tjid) { case 1: productList = ()。 Collection Product productList = null。 ProductListAction類public class ProductListAction extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { ShopCart shopCart = (ShopCart)().getAttribute(shopcart)。 Map map=()。 OrderLine orderline=new OrderLine()。 //如果購(gòu)物車為空就新建一個(gè)購(gòu)物車 String product_id=(product_id)。 return (success)。 String passwd=(passwd)。 }finally{ ()。 (())。 Order order = null。 ()。 tran = ()。 public User login(String name, String passwd)throws ManagerUserException。 public Collection find(Product product)throws ManagerProductException。 }public interface ProductDao { public Product findById(Integer id )throws ManagerProductException。 } public Set getOrderlines() {return orderlines。 } public Integer getId() {return id。 public Order() { } public Order(Integer id) {super()。 private User user。數(shù)據(jù)庫(kù)連接成功,在登錄系統(tǒng)時(shí)會(huì)提示操作員或管理員成功登陸,若數(shù)據(jù)庫(kù)連接失敗,則登錄時(shí)系統(tǒng)會(huì)拋出異常,并提示數(shù)據(jù)庫(kù)連接失敗的錯(cuò)誤,操作員或管理員進(jìn)入不了系統(tǒng)。載入JDBC驅(qū)動(dòng)程序后,必須連接URL指定數(shù)據(jù)庫(kù)服務(wù)器的主機(jī)名、端口和數(shù)據(jù)庫(kù)名。這樣做就自動(dòng)創(chuàng)建了驅(qū)動(dòng)程序的實(shí)例,并注冊(cè)到JDBC驅(qū)動(dòng)程序管理器。 會(huì)員登錄前: 會(huì)員登錄界面圖 會(huì)員登錄后會(huì)員登錄后,界面如圖所示: 以一名叫billdone的會(huì)員登錄后為例: 會(huì)員登錄后操作界面圖 購(gòu)物車購(gòu)物車模塊提供了顧客已選的衣服信息,供用戶選擇是否為購(gòu)物車內(nèi)衣服付款下訂單,可以管理自己已選的衣服信息,選擇刪除衣服,選擇繼續(xù)購(gòu)物,選擇下訂單,: 購(gòu)物車主界面圖 商品詳細(xì)信息商品詳細(xì)信息模塊主要是實(shí)現(xiàn)展示商品具體詳細(xì)直觀的功能,: 商品詳細(xì)信息模塊界面圖 訂單 訂單查詢訂單查詢模塊提供用戶查詢自己所有訂單,: 訂單模塊主界面 購(gòu)物訂單確認(rèn)模塊從購(gòu)物車?yán)镞x擇需要下訂單的衣服后,生成一個(gè)將下訂單的確認(rèn)信息表,讓會(huì)員用戶選擇是否要確認(rèn)下訂單,并在完成預(yù)覽,點(diǎn)擊確認(rèn)訂單后,正式成功生成訂單。: ShoppingCar表結(jié)構(gòu)字段名稱數(shù)據(jù)類型是否為空值約束描述IDIntNO主鍵采購(gòu)員編號(hào)ClotheNameVarchar(50)*采購(gòu)員姓名CountInt*采購(gòu)員性別PriceFloat*電話SumFloat* 服裝管理模塊(ClotheManage)服裝管理模塊中,管理員可以添加服裝信息、管理服裝狀態(tài)。: 系統(tǒng)ER圖 數(shù)據(jù)庫(kù)表設(shè)計(jì)本系統(tǒng)是一個(gè)網(wǎng)上服裝店系統(tǒng),在系統(tǒng)詳細(xì)設(shè)計(jì)之前應(yīng)該對(duì)系統(tǒng)中所涉及到的對(duì)象實(shí)體進(jìn)行信息建模,并最終得到完整的數(shù)據(jù)庫(kù)表結(jié)構(gòu)。根據(jù)以上的分析,本系統(tǒng)采用關(guān)系型數(shù)據(jù)庫(kù)并設(shè)計(jì)了6個(gè)數(shù)據(jù)庫(kù)表,分別是顧客信息表(UserData)、訂單查詢表(OrderData)、留言模塊表(MassageModule)、購(gòu)物車模塊表(ShoppingCar)、服裝管理模塊表(ClotheManage)、會(huì)員管理模塊表(VIPManage)。經(jīng)過(guò)身份驗(yàn)證后,進(jìn)入系統(tǒng)。 訂衣服模塊:購(gòu)物車和訂單查詢來(lái)實(shí)現(xiàn)。 總體功能設(shè)計(jì)本部分主要介紹系統(tǒng)要實(shí)現(xiàn)的功能,搭好設(shè)計(jì)的總體框架,使我們對(duì)要開(kāi)發(fā)的系統(tǒng)有一個(gè)系統(tǒng)、全面、確切的認(rèn)識(shí)。④訂衣服模塊:購(gòu)物車和訂單查詢來(lái)實(shí)現(xiàn)。數(shù)據(jù)庫(kù)設(shè)計(jì)中要合理設(shè)置商品信息和庫(kù)存信息等,用來(lái)實(shí)現(xiàn)商品信息的新增,修改、刪除等功能,使得商家有較詳細(xì)的數(shù)據(jù)統(tǒng)計(jì)與分析。系統(tǒng)采用JSP語(yǔ)言作為開(kāi)發(fā)工具。但它給企業(yè)和商家?guī)?lái)的利潤(rùn)是不可估量的,節(jié)省了許多人力,物力上的開(kāi)支,使網(wǎng)上交易工作變繁為簡(jiǎn),使網(wǎng)上交易更安全,使其更加合理化、規(guī)范化。這些編程語(yǔ)言包括C、C++、Python、Java、Perl、PHP、Eiffel、Ruby和Tcl等。 MySQL 數(shù)據(jù)庫(kù)MySQL是一個(gè)小型關(guān)系型數(shù)據(jù)庫(kù)管理系統(tǒng),開(kāi)發(fā)者為瑞典MySQL AB公司。Struts繼承了MVC的各項(xiàng)特性,并根據(jù)J2EE的特點(diǎn),做了相應(yīng)的變化與擴(kuò)展。尤其是當(dāng)另一批開(kāi)發(fā)者接手這個(gè)項(xiàng)目時(shí),這種優(yōu)勢(shì)體現(xiàn)得更加明顯。Taglib是Struts的標(biāo)記庫(kù),靈活運(yùn)用,能大大提高開(kāi)發(fā)效率。 Struts最早是作為Apache Jakarta項(xiàng)目的組成部分問(wèn)世運(yùn)作。和其他的java架構(gòu)一樣,Struts 也是面向?qū)ο笤O(shè)計(jì),將MVC模式分離顯示邏輯和業(yè)務(wù)邏輯的能力發(fā)揮得淋漓盡致。他現(xiàn)在是Sun的JavaServer Faces (JSR127) 以及J2EE平臺(tái)的Web層架構(gòu)的規(guī)范領(lǐng)導(dǎo)。Struts 代碼基礎(chǔ)由一個(gè)志愿的Commnitter團(tuán)隊(duì)來(lái)管理。除Struts之外,還有其他成功的開(kāi)源產(chǎn)品,包括Tomcat, Ant 和Velocity。Model 1 架構(gòu)單純編寫比較容易,但在Model 1 中JSP 可能同時(shí)肩負(fù)View 與Controll