首页 > 分享 > 【免费】基于Java的网上花店系统项目源码资料资源

【免费】基于Java的网上花店系统项目源码资料资源

package com; import java.util.ArrayList; import java.util.Collection; import java.sql.*; public class GoodsBean { private Connection con; PageNumber pageNumber=new PageNumber(); int rowCount=1; int showPage=16; int pageCount=1; public GoodsBean() { try { con = DBConnection.getConnection(); } catch(Exception e) { e.printStackTrace(); } } public int getRowCount() {return rowCount; } public int getAllPage() { try { Statement statement = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE); ResultSet resultset = statement.executeQuery("select * from Goods");resultset.last();rowCount=resultset.getRow();pageNumber.setPageCount(rowCount,showPage);pageCount=pageNumber.getPageCount(); } catch(Exception e) { e.printStackTrace(); } return pageCount; } public int getAllPageBySort(String s) { try { Statement statement = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE); ResultSet resultset = statement.executeQuery("select * from Goods where sortName='" + s + "'");resultset.last();rowCount=resultset.getRow();pageNumber.setPageCount(rowCount,showPage);pageCount=pageNumber.getPageCount(); } catch(Exception e) { e.printStackTrace(); } return pageCount; } public int getAllPageByPrice(String s) {int a=s.indexOf("-");float one=Float.parseFloat(s.substring(0,a));float two=Float.parseFloat(s.substring(a+1)); try { Statement statement = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE); ResultSet resultset = statement.executeQuery("select * from Goods where goodsPrice between "+one+" and "+two);resultset.last();rowCount=resultset.getRow();pageNumber.setPageCount(rowCount,showPage);pageCount=pageNumber.getPageCount(); } catch(Exception e) { e.printStackTrace(); } return pageCount; } public int getAllPageByMaterial(String s) { try { Statement statement = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE); ResultSet resultset = statement.executeQuery("select * from Goods where goodsmaterial like '%"+s+"%'");resultset.last();rowCount=resultset.getRow();pageNumber.setPageCount(rowCount,showPage);pageCount=pageNumber.getPageCount(); } catch(Exception e) { e.printStackTrace(); } return pageCount; } public Collection getAllGoods(int s) { GoodsClass goods; ArrayList arraylist = new ArrayList(); try { Statement statement = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE); ResultSet resultset = statement.executeQuery("select * from Goods"); int count=0; if(s!=0) {resultset.absolute(s*16); } while(resultset.next()) { goods = new GoodsClass(); int i=resultset.getInt(1); String s1=resultset.getString(2); String s2=resultset.getString(3); String s3=resultset.getString(4); String s4=resultset.getString(5); float f=resultset.getFloat(6); String s5=resultset.getString(7); String s6=resultset.getString(8); String s7=resultset.getString(9); String s8=resultset.getString(10); String s9=resultset.getString(11); goods.setGoodsId(i); goods.setGoodsName(s1); goods.setGoodsmaterial(s2); goods.setGoodsPackage(s3); goods.setGoodsLanguage(s4); goods.setGoodsPrice(f); goods.setGoodsCent(s5); goods.setGoodsScope(s6); goods.setGoodsPlace(s7); goods.setGoodsHabitus(s8); goods.setSortName(s9); arraylist.add(goods); count++; if(count==16) {break; } } con.close(); } catch(Exception e) { e.printStackTrace(); } return arraylist; } public Collection getGoodsBySort(String s,int pageCount) { GoodsClass goods; ArrayList arraylist = new ArrayList(); try { Statement statement = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE); ResultSet resultset = statement.executeQuery("select * from Goods where sortName='" + s + "'");int count=0; if(pageCount!=0) {resultset.absolute(pageCount*16); } while(resultset.next()) { goods = new GoodsClass(); int i=resultset.getInt(1); String s1=resultset.getString(2); String s2=resultset.getString(3); String s3=resultset.getString(4); String s4=resultset.getString(5); float f=resultset.getFloat(6); String s5=resultset.getString(7); String s6=resultset.getString(8); String s7=resultset.getString(9); String s8=resultset.getString(10); String s9=resultset.getString(11); goods.setGoodsId(i); goods.setGoodsName(s1); goods.setGoodsmaterial(s2); goods.setGoodsPackage(s3); goods.setGoodsLanguage(s4); goods.setGoodsPrice(f); goods.setGoodsCent(s5); goods.setGoodsScope(s6); goods.setGoodsPlace(s7); goods.setGoodsHabitus(s8); goods.setSortName(s9); arraylist.add(goods); count++; if(count==16) {break; } }statement.close(); con.close(); } catch(Exception e) { e.printStackTrace(); } return arraylist; } public Collection getGoodsByPrice(String s,int pageCount) { int a=s.indexOf("-");float one=Float.parseFloat(s.substring(0,a));float two=Float.parseFloat(s.substring(a+1)); GoodsClass goods; ArrayList arraylist = new ArrayList(); try { Statement statement = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE); ResultSet resultset = statement.executeQuery("select * from Goods where goodsPrice between "+one+" and "+two);int count=0; if(pageCount!=0) {resultset.absolute(pageCount*16); } while(resultset.next())

相关知识

Java项目源码javaweb花店销售管理系统
【附源码】JAVA计算机毕业设计网上花店管理系统(源码+mysql+文档)
Java网上花店设计(毕设源码+mysql+lw)
基于ssm+vue网上花店销售管理系统【开题+程序+论文】
基于web网上花店销售系统国内外研究现状
计算机毕业设计之 [含实训报告+源码等]javaweb花店管理系统[包运行成功]
网上花店销售系统(附源码+课件+讲解+资料+数据库)
JSP MYSQL网上花店系统 免费下载
Java花店订花管理系统(开题+源码)
基于JAVA的鲜花销售系统(源码+开题)

网址: 【免费】基于Java的网上花店系统项目源码资料资源 https://m.huajiangbk.com/newsview563013.html

所属分类:花卉
上一篇: 情人节求婚送花代表的含义?
下一篇: 灵思斑马鲜花自动贩卖机加盟