URL:https://swapnilbamble1438.github.io/ecommerceapplication/
在日食
單擊文件
選擇導入
從git中選擇項目(帶有智能導入) - >接下來
選擇克隆URI->接下來
在uri糊中此url:https://github.com/swapnilbamble1438/ecommerceapp.git->下一個
現在在當地目的地
繼續 - >接下來
選擇 - >搜索嵌套項目
然後選擇 - >檢測和配置項目本質選項
Now only select EcommerceAppEcommerceApp
-> Finish
如果一切順利,項目將成功導入
現在等待幾秒鐘才能正確加載東西
現在打開項目>打開com.conn軟件包>打開dbconnect.java文件。現在對此文件進行一些更改,更改數據庫文件位置/(mydatabase.db)文件位置/更改“ conn”值,例如:
conn = drivermanager.getConnection(“ jdbc:sqlite:c:/users/swapnil/eclipse- workspace- workspace/在線電子購物/mydatabase.db”);
根據您的myDatabase.db文件位置更改“ conn”值/路徑。
mydatabase.db file will get just inside Project folder only,
Open Project folder you will get mydatabase.db file present.
進行更改後,保存dbconnect.java文件。
右鍵單擊項目>運行為>在服務器上運行>選擇tomcat v8.0+>下一步>完成
現在,網站將開放,如果沒有,請嘗試在瀏覽器中手動打開它,鍵入url:http:// localhost:8082/ecommerceApp
注意:在URL中,根據您的服務器將端口放置。










創建或選擇數據庫
使用該數據庫
插入此查詢:
創建表品牌(bid int默認為null,bname varchar(50)默認為null);
插入品牌價值(1,“三星”),(2,'Sony'),(3,'Lenovo'),(4,'acer'),(5,'onida');
Create Table Cart(名稱Varchar(100)默認為NULL,BNAME VARCHAR(50)默認為NULL,CNAME VARCHAR(50)默認為NULL,PNAME VARCHAR(50)默認值null,pprice int默認null,pquantity int,pquantity int int default int default null,pimage varchar(pimage varchar(200)默認值null);
創建表類別(CID int默認null,cname varchar(50)默認為null);
插入類別值(1,'筆記本電腦'),(2,'tv'),(3,'Mobile'),(4,'Watch');
創建表Contactus(ID int而非null auto_increment,name varChar(100)默認為null,email_id varchar(100)默認為null,contact_no int int默認null,message varchar(8000)默認為null,primary鍵(id));
創建表客戶(name varchar(100)默認為null,密碼varchar(20)默認為null,email_id varchar(100)默認為null,contact_no int int default null);
創建表登錄(用戶名varchar(100)默認為null,密碼varchar(100)默認為null);
插入登錄值('admin','admin');
CREATE TABLE order_details ( Date varchar(100) DEFAULT NULL, Name varchar(100) DEFAULT NULL, bname varchar(50) DEFAULT NULL, cname varchar(50) DEFAULT NULL, pname varchar(50) DEFAULT NULL, pprice int DEFAULT NULL, pquantity int DEFAULT NULL, pimage varchar(200) DEFAULT NULL );
創建表訂單(order_id int not null auto_increment,customer_name varchar(100)默認為null,customer_city varchar(45)默認值null,date varchar(100)默認值null,total_price int default int默認null,status varchar(45)
創建表產品(pid int not null auto_increment,pname varchar(50)默認null,pprice int默認null,pquantity int int默認null,pimage varchar(200)默認null,bid int int default null,cid int null,cid int int default nult null,primary鍵(pid));
插入產品值(5,'Sonysmart',50000,1,'Sonywatch.webp',2,4),(6,'Galaxybook',45000,1,'samsunglaptop.jpg',1,1),(7,','smarttv',28000,1,'oniDatv.jpg'onidatv.jpg',5,5,2) ile.webp',3,3),(9,'aspire',52000,1,'acerlaptop.jpg',4,1),(10,'braviass',52,1,sonytv .jpg',2,2),(11,'GalaxyWatch',22000,1,'galaxywatch.webp',1,4),(14,'kdl',45000,1,'sony kdl.jpg',2,2),(15,'series a7',21000,1,'acer series a7.jpg',4,2),(17,'leo',31000,1,'onida leo.jpg',5,2),(18,'crystal',42000,1,'samsung crystal.webp',1,2),(19,'Aspire 7',55000,1,'acer aspire7.jpg',4,1),(20,'ideapad',37000,1,'lenovo ideapad.jpg',3,1),(21,'legion',51000,1,'lenovo legion.jpg',3,1),(22,'Galaxy Z Fold3',66000,1,'Galaxy z fold3.jpg',1,3),(23,'Galaxy S22',55000,1,'Samsung Galaxy S22.webp',1,3),(24,'Xperia 1v',56000,1,'Sony Xperia Xperia Xperia Xperia 1v.jpg',2,3) a850.jpg',3,3),(27,'Galaxy watch1',8000,1,'galaxy watch.jpg',1,4),(28,'Galaxy Watch2',95000,1,'galaxy watch4.jpg',1,4),(29,'Smart Fit',11000,1,'smart fit.jpg',3,4),(30,'Sony Smart2',12000,1,'Sony Smart2.Webp',2,4),(31,'Gaming Predator',120000,1,'Acer Predator.jpg',4,1),(32,'液體',16000,1,'Acer Liquid.jpg',JPG',4,3),4,3) qled.webp',1,2),(34,'vaio',53000,1,'sony vaio.jpg',2,1),(35,'Xperia Z',32000,1,'Sonyxperiaz.png',2,3);
創建視圖viewlist為選擇brand 。 bname作為bname , category 。 cname作為cname , product 。 pname作為pname , product 。 pprice作為pprice , product 。 pquantity作為pquantity , product 。 pimage as pimage category pimage cid (( brand加入product )上(( brand = product )))將category加入bid ( product = bid cid ));
將視圖mobile設置為選擇brand 。 bname作為bname , category 。 cname作為cname , product 。 pname作為pname , product 。 pprice作為pprice , product 。 pquantity作為pquantity , product 。 pimage as cid category pimage from((( brand加入product ((( brand bid = product )))在(( product = cid ))上加入category ))其中( category = 3 cid bid
創建視圖筆記本laptop作為選擇brand 。 bname作為bname , category 。 cname作為cname , product 。 pname作為pname , product 。 pprice作為pprice , product 。 pquantity作為pquantity , product 。 pimage as pimage as pimage ((( brand加入product上((( brand bid = product )))在(( product = cid cid )上加入category ))其中bid category category = 1 cid ;
將tv視為選擇brand 。 bname作為bname , category 。 cname作為cname , product 。 pname作為pname , product 。 pprice作為pprice , product 。 pquantity作為pquantity , product 。 pimage as pimage category pimage ((( brand加入product on(( brand = product ))) cid在(( product = bid cid )上加入category bid )其中( cid category = 2);
創建watch作為選擇brand 。 bname作為bname , category 。 cname作為cname , product 。 pname作為pname , product 。 pprice作為pprice , product 。 pquantity作為pquantity , product 。從(( brand加入product category的pimage為pimage ((( brand bid product )))在(( product = cid cid )上加入category ))其中( category = 4 cid bid
創建table usermaster(name varchar(100)默認為空,密碼varchar(20)默認為null);
插入usermaster值('admin','admin');
在日食
打開項目>打開com.conn軟件包> open dbconnect.java文件。現在在此文件中進行一些更改,更改“ conn”值,例如
conn = drivermanager.getConnection(“ jdbc:sqlite:c:/users/swapnil/eclipse- workspace- workspace/在線電子購物/mydatabase.db”);
將其更改為
conn = drivermanager.getConnection(“ jdbc:mysql:// localhost:3306/databasename”,“ root”,“ root”);
注意:根據您的數據庫名稱和密碼放置地址。
保存文件
現在嘗試運行項目,並檢查更改是否完成。