package com.zhong.DAO;
import java.sql.Statement;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.swing.JOptionPane;
public class FlowerDao implements BaseDao{
private Object[][] obj;
private Object[] object;
public Object[][] showall(String tablename){
int val = 0;
Connection conn = null;
PreparedStatement ps = null;
Statement s = null;
ResultSet rs = null;
ResultSet rs0 = null;
String sql = "select fname,fprice,fsold,fnum from " + tablename;
String sql0 = "select count(*) from " + tablename;
try {
int count = 0;
conn = new ConnectionFactory().getConnection();
ps = conn.prepareStatement(sql);
s = conn.createStatement();
rs0 = s.executeQuery(sql0);
while(rs0.next()){
val = (int) rs0.getObject(1);
}
obj = new Object[val][4];
rs = ps.executeQuery();
while(rs.next()){
obj[count][0] = rs.getObject(1);
obj[count][1] = rs.getObject(2);
obj[count][2] = rs.getObject(3);
obj[count][3] = rs.getObject(4);
count++;
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
JOptionPane.showInternalMessageDialog(null, "杩炴帴鏁版嵁搴撳け璐�,璇峰皾璇曢噸鏂拌繛鎺�");
}finally{
try {
conn.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
JOptionPane.showInternalMessageDialog(null, "娌℃湁鍏抽棴鏁版嵁搴撹鍏抽棴鏁版嵁搴�");
}
}
return obj;
}
public Object[][] image(){
int val = 0;
Connection conn = null;
PreparedStatement ps = null;
Statement s = null;
ResultSet rs = null;
ResultSet rs0 = null;
String sql = "select fname,fprice,fnum,fimg from Flower";
String sql0 = "select count(*) from Flower";
try {
int count = 0;
conn = new ConnectionFactory().getConnection();
ps = conn.prepareStatement(sql);
s = conn.createStatement();
rs0 = s.executeQuery(sql0);
while(rs0.next()){
val = Integer.parseInt(rs0.getObject(1).toString());
}
obj = new Object[val][4];
rs = ps.executeQuery();
while(rs.next()){
obj[count][0] = rs.getObject(1);
obj[count][1] = rs.getObject(2);
obj[count][2] = rs.getObject(3);
obj[count][3] = rs.getObject(4);
count++;
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
JOptionPane.showInternalMessageDialog(null, "杩炴帴鏁版嵁搴撳け璐�,璇峰皾璇曢噸鏂拌繛鎺�");
}finally{
try {
conn.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
JOptionPane.showInternalMessageDialog(null, "娌℃湁鍏抽棴鏁版嵁搴撹鍏抽棴鏁版嵁搴�");
}
}
return obj;
}
public Object[][] RankbySold(String name){
int val = 0;
Connection conn = null;
PreparedStatement ps = null;
Statement s = null;
ResultSet rs = null;
ResultSet rs0 = null;
String sql = "select fname,fcome,fprice,fsold from Flower order by "+name+" desc";
String sql0 = "select count(*) from Flower";
try {
int count = 0;
conn = new ConnectionFactory().getConnection();
ps = conn.prepareStatement(sql);
s = conn.createStatement();
rs0 = s.executeQuery(sql0);
while(rs0.next()){
val = (int) rs0.getObject(1);
}
obj = new Object[val][5];
rs = ps.executeQuery();
while(rs.next()){
obj[count][0] = rs.getObject(1);
obj[count][1] = rs.getObject(2);
obj[count][2] = rs.getObject(3);
obj[count][3] = rs.getObject(4);
obj[count][4] = (Float.parseFloat(obj[count][2].toString())-Float.parseFloat(obj[count][1].toString()))*Integer.parseInt(obj[count][3].toString());
count++;
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
JOptionPane.showInternalMessageDialog(null, "杩炴帴鏁版嵁搴撳け璐�,璇峰皾璇曢噸鏂拌繛鎺�");
}finally{
try {
conn.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
JOptionPane.showInternalMessageDialog(null, "娌℃湁鍏抽棴鏁版嵁搴撹鍏抽棴鏁版嵁搴�");
}
}
return obj;
}
public Object[][] showall(){
int val = 0;
Connection conn = null;
PreparedStatement ps = null;
Statement s = null;
ResultSet rs = null;
ResultSet rs0 = null;
String sql = "select fname,fcome,fprice,fsold from Flower";
String sql0 = "select count(*) from Flower";
try {
int count = 0;
conn = new ConnectionFactory().getConnection();
ps = conn.prepareStatement(sql);
s = conn.createStatement();
rs0 = s.executeQuery(sql0);
while(rs0.next()){
val = (int) rs0.getObject(1);
}
obj = new Object[val][5];
rs = ps.executeQuery();
while(rs.next()){
obj[count][0] = rs.getObject(1);
obj[count][1] = rs.getObject(2);
obj[count][2] = rs.getObject(3);
obj[count][3] = rs.getObject(4);
obj[count][4] = (Float.parseFloat(obj[count][2].toString())-Float.parseFloat(obj[count][1].toString()))*Integer.parseInt(obj[count][3].toString());
count++;
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
JOptionPane.showInternalMessageDialog(null, "杩炴帴鏁版嵁搴撳け璐�,璇峰皾璇曢噸鏂拌繛鎺�");
}finally{
try {
conn.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
JOptionPane.showInternalMessageDialog(null, "娌℃湁鍏抽棴鏁版嵁搴撹鍏抽棴鏁版嵁搴�");
}
}
return obj;
}
public Object[][] FinaceShow(){
Connection conn = null;
PreparedStatement ps = null;
ResultSet rs = null;
String sql = "select top 6 fname,fsold,fprice,fcome from Flower order by fsold*(fprice-fcome) desc";
try {
int count = 0;
conn = new ConnectionFactory().getConnection();
ps = conn.prepareStatement(sql);
obj = new Object[6][2];
rs = ps.executeQuery();
while(rs.next()){
obj[count][0] = rs.getObject(1);
obj[count][1] = (Integer.parseInt((rs.getObject(2).toString()))*((Float.parseFloat(rs.getObject(3).toString())-(Float.parseFloat(rs.getObject(4).toString())))));
count++;
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
JOptionPane.showInternalMessageDialog(null, "杩炴帴鏁版嵁搴撳け璐�,璇峰皾璇曢噸鏂拌繛鎺�");
}finally{
try {
conn.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
JOptionPane.showInternalMessageDialog(null, "娌℃湁鍏抽棴鏁版嵁搴撹鍏抽棴鏁版嵁搴�");
}
}
return obj;
}
public Object[] FindShow(String name){
Connection conn = null;
PreparedStatement ps = null;
ResultSet rs = null;
String sql = "select fname,fcome,fnum,fprice,fsold,fimg from Flower where fname like '%"+name+"%'";
try {
conn = new ConnectionFactory().getConnection();
ps = conn.prepareStatement(sql);
object = new Object[6];
rs = ps.executeQuery();
while(rs.next()){
object[0] = rs.getObject(1);
object[1] = rs.getObject(2);
object[2] = rs.getObject(3);
object[3] = rs.getObject(4);
object[4] = rs.getObject(5);
object[5] = rs.getObject(6);
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
JOptionPane.showInternalMessageDialog(null, "杩炴帴鏁版嵁搴撳け璐�,璇峰皾璇曢噸鏂拌繛鎺�");
}finally{
try {
conn.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
JOptionPane.showInternalMessageDialog(null, "娌℃湁鍏抽棴鏁版嵁搴撹鍏抽棴鏁版嵁搴�");
}
}
return object;
}
@Override
public Boolean delete(String tablename,int id) {
// TODO Auto-generated method stub
int count;
Connection conn = null;
Prepared
没有合适的资源?快使用搜索试试~ 我知道了~
花店管理系统
共149个文件
class:72个
java:37个
jpg:28个
5星 · 超过95%的资源 需积分: 50 240 下载量 74 浏览量
2015-12-28
20:05:47
上传
评论 25
收藏 3.95MB ZIP 举报
温馨提示
课程设计——花店管理系统源码。附有所有源码图片。
资源推荐
资源详情
资源评论
收起资源包目录
花店管理系统 (149个子文件)
FlowerDao.class 9KB
GeneralPanel.class 7KB
MainFinancePanel.class 6KB
OrderDao.class 5KB
AddOrderPanel.class 5KB
MemberAddPanel.class 5KB
AddFlowerPanel.class 5KB
MainOrderPanel.class 4KB
FlowEditPanel.class 4KB
MemberDao.class 4KB
FindPanel.class 4KB
MainMemberPanel.class 4KB
OrderPanel.class 3KB
LoginPanel.class 3KB
BarChart.class 3KB
AddOrderPanel$2.class 3KB
ExcelExporter.class 3KB
ReceivePicture.class 2KB
AddFlowerPanel$2.class 2KB
MainEditPanel.class 2KB
SelectDir.class 2KB
MainflowerPanel.class 2KB
AddFlowerPanel$1.class 2KB
FlowEditPanel$1.class 2KB
GeneralPanel$9.class 2KB
FlowerEditModel.class 2KB
MyRender.class 2KB
GeneralPanel$8.class 2KB
SendPicture.class 2KB
MainOrderPanel$5.class 1KB
MainOrderPanel$3.class 1KB
Member.class 1KB
FileOpen.class 1KB
MemberAddPanel$3.class 1KB
LoginPanel$1.class 1KB
Order.class 1KB
Flower.class 1KB
TableModel.class 1KB
MainFinancePanel$5.class 1KB
ConnectionFactory.class 1KB
MainEditPanel$1.class 1KB
GeneralPanel$4.class 1KB
GeneralPanel$5.class 1KB
GeneralPanel$3.class 1KB
GeneralPanel$2.class 1KB
GeneralPanel$1.class 1KB
ReceivePicture$1.class 1KB
MP3Player.class 1016B
MainFinancePanel$3.class 1002B
MainFinancePanel$4.class 1002B
MainFinancePanel$1.class 999B
MainFinancePanel$2.class 999B
MainOrderPanel$1.class 927B
MainshowPanel.class 926B
MainPanel.class 885B
MainOrderPanel$2.class 835B
MainOrderPanel$4.class 760B
GeneralPanel$6.class 757B
GeneralPanel$7.class 754B
MainMemberPanel$2.class 746B
MemberAddPanel$1.class 741B
MemberAddPanel$2.class 741B
LoginPanel$2.class 740B
AddOrderPanel$1.class 735B
PicTransparent.class 732B
OrderPanel$1.class 724B
MainMemberPanel$1.class 717B
FindPanel$1.class 708B
MemberEditModel.class 663B
MemberRender.class 663B
Manager.class 442B
BaseDao.class 286B
.classpath 607B
jfreechart-1.0.13.jar 1.36MB
jxl.jar 709KB
sqljdbc4.jar 571KB
jcommon-1.0.16.jar 302KB
jl1.0.1.jar 103KB
FlowerDao.java 9KB
GeneralPanel.java 7KB
MainFinancePanel.java 6KB
AddOrderPanel.java 5KB
OrderDao.java 5KB
MemberAddPanel.java 5KB
AddFlowerPanel.java 4KB
LoginPanel.java 4KB
FindPanel.java 4KB
FlowEditPanel.java 4KB
MainOrderPanel.java 3KB
BarChart.java 3KB
MemberDao.java 3KB
OrderPanel.java 3KB
MainMemberPanel.java 2KB
ExcelExporter.java 2KB
ReceivePicture.java 2KB
MainEditPanel.java 2KB
FlowerEditModel.java 2KB
SelectDir.java 1KB
MyRender.java 1KB
FileOpen.java 1KB
共 149 条
- 1
- 2
资源评论
- 孑流丶2019-09-04可惜了,不是我想要的
- zhuo��怀2019-09-04代码可以再详细一点吗
- 覃同学2020-06-14我下载完没有找到数据库,请问里边有数据库吗
- Sivan0072017-12-14后台配置讲一讲
passer_zzy
- 粉丝: 40
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 处理数据的界面,使用pyqt+pandas开发da-console-tool-master.zip
- pandas 使用笔记study-pandas-master.zip
- 基于matlab的薛定谔方程数值计算应用源码(下载即用).zip
- docker ps: 列出运行中的容器 提供一个完整的微服务架构轻量级支撑运行时系统.zip
- 基于CS5080+TP4056 芯片5V输入4.2V 8.4V输出锂电充电控制板硬件(原理图+PCB)文件.zip
- 常用docker的参考命令.zip
- 基于matlab实现的模糊聚类分析项目源码.zip
- docker build: 从 Dockerfile 构建一个镜像
- 基于springboot的医院门诊管理系统源码.zip
- 基于python的垃圾分类系统源码(高分优质项目).zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功