源码编号:F-A14

项目类型:Java SE项目(GUI图形界面)

项目名称:商城购物系统,开源免费

用户类型:双角色(会员、管理员)

主要技术:java、awt、swing、等技术

开发工具:Eclipse

运行工具:Eclipse/MyEclipse/IDEA都可以,eclipse最兼容

数  据  库:MySQL5.7以上

项目简介:本系统主要的功能有会员注册、登录、商品种类管理、商品管理、浏览商品、以及购物车等操作。

源码领取方式:个人主页置顶文章领取。

以下是部分截图

项目骨架

主界面

登录

添加商品类别

商品管理

以下是核心代码

package com.dao;import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;import com.model.Customer;
import com.model.ManagerUser;public class CustomerUserDao {public int customerAdd(Connection con,Customer customer)throws Exception{String sql="insert into t_customer values(null,?,?,?,?)";PreparedStatement pstmt=con.prepareStatement(sql);pstmt.setString(1, customer.getCustomerName());pstmt.setString(2, customer.getPassword1());pstmt.setString(3, customer.getPassword2());pstmt.setFloat(4, customer.getMoney());return pstmt.executeUpdate();}public  Customer login(Connection con, Customer customer)throws Exception{Customer resultUser=null;String sql="select * from t_customer where customerName=? and password1=?";PreparedStatement pstmt=con.prepareStatement(sql);pstmt.setString(1, customer.getCustomerName());pstmt.setString(2,customer.getPassword1());ResultSet rs=pstmt.executeQuery();if(rs.next()){resultUser=new Customer();resultUser.setCustomerName(rs.getString("customerName"));resultUser.setPassword1(rs.getString("password1"));}return resultUser;}
}

以下是部分核心代码

package com.dao;import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;import com.model.Product;
import com.util.StringUtil;public class ProductDao {public int productAdd(Connection con,Product product)throws Exception{String sql="insert into t_product values(null,?,?,?,?,?)";PreparedStatement pstmt=con.prepareStatement(sql);pstmt.setString(1, product.getProductName());pstmt.setString(2,product.getProductTime());pstmt.setFloat(3, product.getPrice());pstmt.setString(4, product.getProductDesc());pstmt.setInt(5, product.getProductTypeId());return pstmt.executeUpdate();}public int productAddIntoCar(Connection con,Product product)throws Exception{String sql="insert into t_productchosen values(null,?,?,?,?,?)";PreparedStatement pstmt=con.prepareStatement(sql);pstmt.setString(1, product.getProductName());pstmt.setString(2,product.getProductTime());pstmt.setFloat(3, product.getPrice());pstmt.setString(4, product.getProductDesc());pstmt.setInt(5, product.getProductTypeId());return pstmt.executeUpdate();}//如果是罗列的话,只需con就行了public ResultSet productList(Connection con,Product product)throws Exception{StringBuffer sb=new StringBuffer("select * from t_product p,t_productType pt where p.productTypeId=pt.id ");if(StringUtil.isNotEmtpty(product.getProductName())){sb.append(" and p.productName like '%"+product.getProductName()+"%'");}//查询语句的经典算法, 设置数据文件的搜索路径appendif(StringUtil.isNotEmtpty(product.getProductTime())){sb.append(" and p.productTime like '%"+product.getProductTime()+"%'");}//查询语句的经典算法, 设置数据文件的搜索路径appendif(product.getProductTypeId()!=-1){sb.append(" and p.productTypeId ="+product.getProductTypeId());}//查询语句的经典算法, 设置数据文件的搜索路径appendPreparedStatement pstmt=con.prepareStatement(sb.toString());return pstmt.executeQuery();}public ResultSet productChosenList(Connection con)throws Exception{String sql="select * from t_productchosen p,t_productType pt where p.productTypeId=pt.id ";PreparedStatement pstmt=con.prepareStatement(sql);return pstmt.executeQuery();}public int productDelete(Connection con,String id)throws Exception{String sql="delete from t_product where id=?";PreparedStatement pstmt=con.prepareStatement(sql);pstmt.setString(1, id);return pstmt.executeUpdate();}public int productChosenDelete(Connection con,String id)throws Exception{String sql="delete from t_productchosen where id=?";PreparedStatement pstmt=con.prepareStatement(sql);pstmt.setString(1, id);return pstmt.executeUpdate();}public int productModify(Connection con,Product product)throws Exception{String sql="update t_product set productName=?,productTime=?,price=?,productDesc=?,productTypeId=? where id=?";PreparedStatement pstmt=con.prepareStatement(sql);pstmt.setString(1, product.getProductName());pstmt.setString(2, product.getProductTime());pstmt.setFloat(3, product.getPrice());pstmt.setString(4, product.getProductDesc());pstmt.setInt(5, product.getProductTypeId());pstmt.setInt(6, product.getId());return pstmt.executeUpdate();}public boolean getProductByProductTypeId(Connection con,String productTypeId)throws Exception{String sql="select * from t_product where productTypeId=?";PreparedStatement pstmt=con.prepareStatement(sql);pstmt.setString(1, productTypeId);ResultSet rs=pstmt.executeQuery();return rs.next();}
}

基于Java的商城购物系统相关推荐

  1. 基于JAVA体育用品购物系统计算机毕业设计源码+系统+mysql数据库+lw文档+部署

    基于JAVA体育用品购物系统计算机毕业设计源码+系统+mysql数据库+lw文档+部署 基于JAVA体育用品购物系统计算机毕业设计源码+系统+mysql数据库+lw文档+部署 本源码技术栈: 项目架构 ...

  2. 基于JAVA宠物用品商城服务系统计算机毕业设计源码+系统+lw文档+部署

    基于JAVA宠物用品商城服务系统计算机毕业设计源码+系统+lw文档+部署 基于JAVA宠物用品商城服务系统计算机毕业设计源码+系统+lw文档+部署 本源码技术栈: 项目架构:B/S架构 开发语言:Ja ...

  3. 基于SSM网上商城购物系统的设计与实现

    项目描述 临近学期结束,还是毕业设计,你还在做java程序网络编程,期末作业,老师的作业要求觉得大了吗?不知道毕业设计该怎么办?网页功能的数量是否太多?没有合适的类型或系统?等等.这里根据疫情当下,你 ...

  4. nodejs基于vue 网上商城购物系统

    可定制框架:ssm/Springboot/vue/python/PHP/小程序/安卓均可开发 目录 1 绪论 1 1.1课题背景 1 1.2课题研究现状 1 1.3初步设计方法与实施方案 2 1.4本 ...

  5. java计算机毕业设计ssm基于JAVA的网上购物系统-商城购物网站

    项目介绍  本网上购物网站是针对目前商城的实际需求,从实际工作出发,对过去的网上购物存在的问题进行分析,完善用户的使用体会.采用计算机系统来管理信息,取代人工管理模式,查询便利,信息准确率高,节省了开 ...

  6. 《基于Java的网上购物系统的设计与开发》 硕士论文

    这个论文基本上复刻了淘宝平台的一整套购物系统,在模块,功能方面也写得很详细,逻辑图的呈现也让我对整套功能体系更加熟悉. 语言:java 技术: struts    (好像springboot用的人更多 ...

  7. 开题报告:基于java多用户商城平台系统 毕业设计论文开题报告模板

    开发操作系统:windows10 + 4G内存 + 500G 开发环境:JDK1.8 + Tomcat8 开发语言:Java 开发框架:springboot 模板引擎:Thymeleaf 开发工具:I ...

  8. java商城答辩_毕业答辩-基于Java的网上购物商城的设计与实现.ppt

    指导老师: 答辩人: 学号: 学院:信息工程学院 基于JAVA的网上购物系统的设计与实现 1 2 绪论 技术介绍和系统设计 3 系统的实现 4 结论与展望 一.绪论 随着网络的蓬勃发展,电子商务技术在 ...

  9. ssm基于jsp的网上购物系统 毕业设计-附源码190917

    网上购物系统的设计与实现 摘 要 近年来,随着移动互联网的快速发展,电子商务越来越受到网民们的欢迎,电子商务对国家经济的发展也起着越来越重要的作用.简单的流程.便捷可靠的支付方式.快捷畅通的物流快递. ...

最新文章

  1. Commvault公司营收增长 但本季度仍身陷亏损
  2. 在codeblocks中使用C++11标准,安装及配置方法
  3. iis7 php安装教程,iis7 php安装方法详解
  4. 论文笔记之:Instance-aware Semantic Segmentation via Multi-task Network Cascades
  5. Hadoop 2.2.0 集群搭建
  6. 为什么相关性不等于因果性?终于有人讲明白了
  7. 面试题:如何实现丝滑般的数据库扩容
  8. python编译出来的程序员_Windows下编译Python2.7源码
  9. 群体智能优化算法之萤火虫群优化算法(Glowworm Swarm Optimization,GSO)
  10. 《高质量C++/C编程指南(林锐)》学习笔记
  11. java实现简单的文字pk的小游戏
  12. 多子群的共生非均匀高斯变异樽海鞘群算法-附代码
  13. 各国市场分析(越南,智利)
  14. 作为一个大学才开始入门学计算机编程的孩子想要的东西-----听我扯,你蛋疼,他菊紧,我开心
  15. 终于搞懂python通过twain模块控制扫描仪了
  16. 手游虚拟机服务器,手游大话西游虚拟机镜像一键服务端+配套客户端+启动教程+GM后台...
  17. oppo小布机器人_腾讯宠粉狂欢季丨OPPO手机、腾讯听听音箱、小布AI机器人……100+份豪礼免费送!...
  18. 计算机基本基础知识实训总结,计算机基础实训总结范文
  19. java毕业设计——基于java+JSP+MySQL的电脑彩票销售管理系统设计与实现(毕业论文+程序源码)——彩票销售管理系统
  20. 职高学生计算机学情分析,高职学生学情分析

热门文章

  1. 正则表达式获取图片地址及超链接
  2. java递归堆栈溢出_【java】递归次数过多导致堆栈溢出
  3. 炼数成金数据分析课程---7、数据分析简介
  4. 基于 SPI 协议的0.96 寸OLED显示
  5. java 生成图片验证码结合struts2使用
  6. 3.6 使用透视裁剪工具修复透视图 [Ps教程]
  7. Azure 深入浅出[2] --- App Service的部署并查看应用Log
  8. 关于Niche站运营,我有几句话要说
  9. SVN权限的简单配置
  10. 【视频开发】ONVIF客户端搜索设备获取rtsp地址开发笔记(精华篇)