當前位置:首頁 » 網購平台 » j2ee網上購物系統
擴展閱讀
寧波奧德賽優惠價格 2021-03-15 14:26:02
丹尼斯購物卡能掛失么 2021-03-15 14:25:58
淘寶購物指紋驗證失敗 2021-03-15 14:24:44

j2ee網上購物系統

發布時間: 2021-02-12 06:02:41

A. 關於J2EE技術的網上購物車系統的代碼 用Java寫的

功能基本都已實現,如你所說,重復添加至購物車不能累加數量的bug還沒修復,希望能幫到你。

還有資料庫為oracle

B. 如何用J2EE標准製作中小型購物網站

如果是自己去做一個購物網站,推薦你採用以下步驟

一、項目大致分析
我這個網站做來干什麼,有什麼用,幾個人做,多長時間做完,採用什麼架構,需要用到什麼技術等。

二、具體分析
既然是用Java做,你就不得不用面向對象的思維來分析問題。
首先,找出整個項目中的實體及屬性
比方說,你這個系統至少應該抽象出這么幾個實體
用戶(用戶編號、用戶名、密碼、性別等其他信息)
商品(商品編號、商品名、商品分類、單價、描述等信息)
商品分類(分類編號、分類描述等信息)
訂單(訂單編號、購買者、商品編號、數量、訂單日期等信息)

諸如此類,所有可能或可以被抽離出來的實體都要抽離出來,然後建立彼此的關系。形成一張E-R圖,最後由此圖建立資料庫模型。

三、框架設計
有了資料庫模型後,接下來應該到網站的架構設計,比方你採用什麼結構。一般有如下幾種結構
簡單實用型:JSP+JavaBean
簡單實用MVC型:JSP+Servlet+JavaBean
分布式企業開發1:JSP+Servlet+EJB
框架集成型1:JSP+Struts+Spring+Hibernate
框架集成型2:Freemarter+WebWork+Spring+JDBC(Hibernate)
框架+分布式:JSP+Struts(WebWork)+EJB
等等
當然你說,看了這么多,我也不知道改用哪種,那我來推薦一種
JSP+Servlet+JavaBean的MVC型,適合你這種小型網站的開發。

決定開發類型後,准備開發環境和必備工具
例如如果用EJB,就下載JBuilder
如果是用框架,就下載Eclipse,推薦使用Eclipse,當然你可以使用插件MyEclipse

四、代碼實現
這一塊比較麻煩。
我假設使用JSP+Servlet+JavaBean
首先從底層代碼入手,也就是從DAO層,編寫一個公用的,功能強大的Dao介面,供高層調用。
然後寫實體類的JavaBean,基本上一個實體類JavaBean對應一個資料庫的表,或者一個視圖。
然後寫業務方法,所有的Service都調用共有的Dao方法來實現業務邏輯。當然這些Service就是業務類的JavaBean
最後寫Servlet和JSP頁面。寫完一個測試一個,因為一個Servlet和一個JSP就是一個功能模塊。你項目小,只有自己來測試這些功能模塊。

做完這些後,開始美化頁面,這時候可以使用Dreamweaver來美化頁面。順便檢查頁面上的js驗證代碼。

五、測試
測試是肯定要的。這看你個人了

六、上線
測試OK之後,可以考慮租空間,買域名,將項目上線。

大概說到這里,希望對你有幫助。

C. 我要J2EE的系統,隨便什麼,網上購物、招聘管理啦。。。。。

奧,好的。
希望可以幫你。

D. j2ee三層結構網上購物商城

兩個什麼功能?

E. 求J2EE網上購物系統

http://www.java1234.com/a/kaiyuan/javaWeb/2013/0701/438.html去看看吧。 高清視頻講解下載地址: 源碼及資料庫腳本下載地址:http://pan..com/share/link?shareid=1368600394&uk=3442963673 統一環境搭建說明:http://www.java1234.com/a/kaiyuan/java/2013/0419/228.html 項目部署常見問題說明:http://www.java1234.com/a/kaiyuan/java/2013/0506/315.html

F. 基於J2EE網上購物系統是如何實現的

頁面放抄個登錄的form,請求帶著用戶名密碼信息、發往後台;
後台——
如果是spring,就找對應的controller;
如果是struts,就找對應的action;
不管是controller還是action,他們都會調用對應的邏輯來判斷登錄成功失敗
並進行頁面跳轉。

成功了就跳進商店,失敗了繼續登錄~

G. 用J2EE+Access資料庫做一個小項目,例如網上新聞發布系統,小型的網上購物系統,學生信息管理系統

這個程序,最好自己學習寫一下。寫起來也不麻煩,access資料庫的程序都是相對簡單的。只有簡單的程序會寫了,對於後期復雜的程序系統才能很少出現bug。

H. 求J2EE的網上圖書銷售系統

1)getRequest()方法
該方法負責從頁面接收到的表單資料分解,並設置圖書實體的相應屬性,它的返回值為Boolean類型,true表示成功,反之表示失敗。部分代碼如下:
public boolean getRequest(javax.servlet.http.HttpServletRequest newrequest) {
boolean flag = false;
try{
request = newrequest;
String ID = request.getParameter("id");
long bookid = 0;
try{
bookid = Long.parseLong(ID);
}catch (Exception e){
}
abooks.setId(bookid);
String bookname = request.getParameter("bookname");
if (bookname==null || bookname.equals(""))
{
bookname = "";
sqlflag = false;
}
abooks.setBookName(to_String(bookname));
String author = request.getParameter("author");
if (author==null || author.equals(""))
{
author = "";
sqlflag = false;
}
abooks.setAuthor(to_String(author));
String publish = request.getParameter("publish");;
if (publish==null)
{
publish = "";
}
abooks.setPublish(to_String(publish));
String bookclass = request.getParameter("bookclass");
int bc = Integer.parseInt(bookclass);
abooks.setBookClass(bc);
String bookno = request.getParameter("bookno");
if (bookno == null)
{
bookno = "";
}
abooks.setBookNo(to_String(bookno));
String picture = request.getParameter("picture");
if (picture == null)
{
picture = "images/01.gif";
}
abooks.setPicture(to_String(picture));
float price;
try {
price =new Float(request.getParameter("price")).floatValue();
} catch (Exception e){
price = 0;
sqlflag = false;
}
abooks.setPrince(price);
int amount;
try{
amount = new Integer(request.getParameter("amount")).intValue();
}catch (Exception e){
sqlflag = false;
amount = 0;
}
abooks.setAmount(amount);
String content = request.getParameter("content");
if (content == null)
{
content = "";
}
abooks.setContent(to_String(content));
if (sqlflag)
{
flag = true;
}
return flag;
}catch (Exception e){
return flag;
}
}
2)book_search()方法
該方法負責圖書查詢,包括圖書的分類,分頁、關鍵字查詢。首先通過getRequest()方法獲得頁面表單參數值,根據參數值判斷是何種查詢,然後根據相應的SQL的語句從資料庫里查詢相應的值。這里需要用到分頁技術。
部分代碼如下:
/**
* 完成圖書查詢,包括分類,分頁查詢
* @param res
* @return
* @throws java.lang.Exception
*/
public boolean book_search(HttpServletRequest res) throws Exception {
DataBase db = new DataBase();
db.connect();
Statement stmt = db.conn.createStatement ();
request = res;
String PAGE = request.getParameter("page"); //頁碼
String classid = request.getParameter("classid");//分類ID號
String keyword = request.getParameter("keyword");//查詢關鍵詞
if (classid==null) classid="";
if (keyword==null) keyword = "";
keyword = to_String(keyword).toUpperCase();
try {
page = Integer.parseInt(PAGE);
}catch (NumberFormatException e){
page = 1;
}
//取出記錄數
if (!classid.equals("") && keyword.equals("") ) {
sqlStr = "select count(*) from book where bookclass='"+classid + "'";
}
else if (!keyword.equals("")) {
if (classid.equals("")){
sqlStr = "select count(*) from book where upper(bookname) like '%" +
keyword+ "%' or upper(content) like '%" + keyword + "%'";
} else {
sqlStr = "select count(*) from book where bookclass='" + classid
+ "' and (upper(bookname) like '%" +keyword+ "%' or "+
"upper(content) like '%" + keyword + "%')";
}
} else {
sqlStr = "select count(*) from book";
}
int rscount = pageSize;
try {
ResultSet rs1 = stmt.executeQuery(sqlStr);
if (rs1.next()) recordCount = rs1.getInt(1);
rs1.close();
}catch (SQLException e){
System.out.println(e.getMessage());
return false;
}
//設定有多少pageCount
if (recordCount < 1)
pageCount = 0;
else
pageCount = (int)(recordCount - 1) / pageSize + 1;
//檢查查看的頁面數是否在范圍內
if (page < 1)
page = 1;
else if (page > pageCount)
page = pageCount;
rscount = (int) recordCount % pageSize; // 最後一頁記錄數
//sql為倒序取值
sqlStr = "select a.id,a.bookname,a.bookclass,b.classname,"+
"a.author,a.publish,a.bookno,a.content,a.prince,a.amount,"+
"a.Leav_number,a.regtime,a.picture from book a,bookclass b"+
" where a.Bookclass = b.Id ";
if (!classid.equals("") && keyword.equals("") ){ //如果類別不為空,非查詢
if (page == 1)
{
sqlStr = sqlStr + " and a.bookclass='" + classid + "' "+
"order by a.Id desc";
} else {
sqlStr = sqlStr + " and a.bookclass='" + classid + "limit "+
(recordCount-pageSize * page)+","+(recordCount-pageSize * (page-1));
}
} else if (!keyword.equals("")) { //如果是查詢資料
if (page == 1){
if (!classid.equals("")) {//查詢某一類
sqlStr = sqlStr + "and a.Bookclass='" +
classid + "' and (upper(a.bookname) like '%" +
keyword+ "%' or upper(a.content) like '%" +
keyword + "%') order by a.Id desc";
} else { //查詢所有類
sqlStr = sqlStr + " and (upper(a.bookname) like '%" +
keyword+ "%' or upper(a.content) like '%" +
keyword + "%') order by a.Id desc";
}
} else {
if (!classid.equals("")){
sqlStr = sqlStr + " and a.Bookclass='" +
classid + "' and (upper(a.bookname) like '%" +
keyword+ "%' or upper(a.content) like '%" +
keyword + "%') limit "+(recordCount-pageSize * page)+","+
(recordCount-pageSize * (page-1));
} else {
sqlStr = sqlStr + " and (upper(a.bookname) like '%" +
keyword+ "%' or upper(a.content) like '%" +
keyword + "%') limit "+(recordCount-pageSize * page)+","+
(recordCount-pageSize * (page-1));
}
}
} else {//非查詢,也非分類瀏覽
if (page == 1){
sqlStr = sqlStr + " order by a.Id desc limit 0,"+pageSize;
} else {
sqlStr = sqlStr + "limit "+(recordCount-pageSize * page)+","+
(recordCount-pageSize * (page-1));
}
}
try {
rs = stmt.executeQuery(sqlStr);
booklist = new Vector(rscount);
while (rs.next()){
book book = new book();
book.setId(rs.getLong("id"));
book.setBookName(rs.getString("bookname"));
book.setBookClass(rs.getInt("bookclass"));
book.setClassname(rs.getString("classname"));
book.setAuthor(rs.getString("author"));
book.setPublish(rs.getString("publish"));
book.setBookNo(rs.getString("Bookno"));
book.setContent(rs.getString("content"));
book.setPrince(rs.getFloat("prince"));
book.setAmount(rs.getInt("amount"));
book.setLeav_number(rs.getInt("leav_number"));
book.setRegTime(rs.getString("regtime"));
book.setPicture(rs.getString("picture"));
booklist.addElement(book);
}
rs.close();
return true;
}catch (Exception e){
System.out.println(e.getMessage());
return false;
}
}
3)insert()方法
該方法負責圖書的添加,返回類型為Boolean型,true表示成功,反之失敗。首先從圖書對象中獲得屬性,組裝相應的SQL語句並執行,返回執行結果。代碼如下:
/**
* 完成圖書添加
* @return
* @throws java.lang.Exception
*/
public boolean insert() throws Exception {
sqlStr = "insert into book (Bookname,Bookclass,Author,Publish,Bookno,"+
"Content,Prince,Amount,Leav_number,Regtime,picture) values ('";
sqlStr = sqlStr + dataFormat.toSql(abooks.getBookName()) + "','";
sqlStr = sqlStr + abooks.getBookClass() + "','";
sqlStr = sqlStr + dataFormat.toSql(abooks.getAuthor()) + "','";
sqlStr = sqlStr + dataFormat.toSql(abooks.getPublish()) + "','";
sqlStr = sqlStr + dataFormat.toSql(abooks.getBookNo()) + "','";
sqlStr = sqlStr + dataFormat.toSql(abooks.getContent()) + "','";
sqlStr = sqlStr + abooks.getPrince() + "','";
sqlStr = sqlStr + abooks.getAmount() + "','";
sqlStr = sqlStr + abooks.getAmount() + "',";
sqlStr = sqlStr + "now()"+ ",'";
sqlStr = sqlStr + abooks.getPicture()+"')";
try{
System.out.print(sqlStr);
DataBase db = new DataBase();
db.connect();
stmt =db.conn.createStatement ();
stmt.execute(sqlStr);
return true;
}catch (SQLException sqle){
System.out.print(sqle.getMessage());
return false;
}
}
5.4客戶界面設計
5.4.1界面頭、界面尾設計
為了提高代碼的重用性,我把客戶界面部分相同的頭和尾做成兩個模塊,分別命名為 head.inc 和tail.inc,這兩個文件都是純 HTML代碼,在頭和尾引入下面的兩句代碼方可;
<%@include file=」/bookshop/inc/head.inc」%>
<%@include file=」/bookshop/inc/tail.inc」%>

I. 求最簡單的J2EE網上購物系統 要求在問題補充 有的請發郵箱謝謝

這個蠻簡單的,有人給你發了沒?