ImageVerifierCode 换一换
格式:DOCX , 页数:18 ,大小:17.33KB ,
资源ID:11578260      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bingdoc.com/d-11578260.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(网上书店完整代码.docx)为本站会员(b****2)主动上传,冰点文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰点文库(发送邮件至service@bingdoc.com或直接QQ联系客服),我们立即给予删除!

网上书店完整代码.docx

1、网上书店完整代码附录 全部源代码package class Connect private static Connection con = null; private static String url=jdbc:oracle:thin:localhost:1521:ORCL; private static String driver = ; private static String user = scott; private static String pwd = tiger; public static Connection getConnection() try (driver); c

2、on = (url, user, pwd); 数据库连接成功!); catch (ClassNotFoundException e) 驱动加载失败!); catch (SQLException e) 数据库连接失败!); return con; public static void main(String args) (); package class docMenuAction implements ActionListener RegisterFrame register = null; JPanel cusPanel = null; JPanel docPanel = null; pub

3、lic docMenuAction(RegisterFrame register) = register; = ; = ; public void actionPerformed(ActionEvent e) 于用户搜索商品 public ArrayList getAllSellerGoods() ArrayList list = new ArrayList(); conn = (); try statement = (); String sql = select * from goods a,seller b where =; resultSet = (sql); while() Selle

4、r seller = new Seller(); (seller_name); (address); Goods goods = new Goods(); (seller); (goods_id); (goods_name); (seller_id); (discount); (num); (price); 2012-9-192012-9-192012-9-192012-9-19etImage(); (null); (null); (false);etImage(); (600, 400); ; (null); (menuBar,; setGoodsPanel(); ; (goodsPanel

5、,; ; setSouthPanel(); setOrderPanel(); (southPanel,; quals() (null, 请输入商品编号或商品数量!); else int id = (); int num = (String) (); goods = (id); if(null, 您确定要购买吗)=0) if()=0) (null, 商品编号输入错误!); else if()num) (null, 商品数量不足!); else ()-num); (goods); OrderDao order = new OrderDao(); (goods, num); (null, 购买成功!

6、); setAr(); setOr(); (); else ); etName(); ari7=().getAddress(); private void setArNull() for(int i=0;i;i+) for(int j=0;jari.length;j+) arij=; etName(); ori3=().getPrice(); ori4=().getDiscount(); ori5=().getPrice()*().getDiscount()*; ori6=(); ori7=().getName(); ori8=().getAddress(); private void set

7、OrNull() for(int i=0;i;i+) for(int j=0;jori.length;j+) orij=; public static void main(String args) BuyerFrame frame = new BuyerFrame(); (true); package class LoginFrame extends JFrame private JLabel userNameLabel = new JLabel(用户名:); private JLabel pwdLabel = new JLabel(密 码:); private JTextField useN

8、ameText = new JTextField(); private JPasswordField pws = new JPasswordField(); private JLabel roleLabel = new JLabel(角色:); private JComboBox roleBox = new JComboBox(new String商家,买家); private JButton bt = new JButton(确定); private JButton btR = new JButton(取消); private String flag = null; public Login

9、Frame() init(); private void init() (320, 280); (登录); (new ImageIcon(images/).getImage(); (null); (false); ; (null); (40, 20, 150, 30); (userNameLabel); (120, 20, 150, 30); (useNameText); (40, 80, 150, 30); (pwdLabel); (120, 80, 150, 30); (pws); (40, 140, 70, 30); (roleLabel); (120, 140, 150, 30); (

10、roleBox); (40, 200, 70, 30); (btR); (new ActionListener() Override public void actionPerformed(ActionEvent e) quals(f) flag = seller; if(买家.equals(f) flag = customer; if(seller.equals(flag) Seller seller = (), (); -+(); if()=null) (null, 用户名或密码输入错误); else setVisible(false); SellerFrame fame = new Se

11、llerFrame(); (true); if(customer.equals(flag) Buyer buyer = (), (); if()=null) (null, 用户名或密码输入错误); else setVisible(false); BuyerFrame frame = new BuyerFrame(); (true); 2012-9-20etImage(); (300, 400);etImage(); (600, 400); ; (null); (menuBar,; setGoodsPanel(); ; (goodsPanel,; ; setSouthPanel(); setOr

12、derPanel(); (southPanel,; quals() (null, 请输入商品编号!); else int id = (); UpdateFrame frame = new UpdateFrame(); Goods goods = new GoodsDao().getOneGoods(id); if()!=0) (goods); (goods); (true); else (null, 商品编号输入错误!); ); (btDelet); quals() (null, 请输入商品编号!); else int id = (); GoodsDao dao = new GoodsDao(

13、); if(null, 您确定要删除吗)=0) if(id)!=0) (null, 删除成功!); else (null, 商品编号输入错误!); else ); (btAdd); (new ActionListener() Override public void actionPerformed(ActionEvent e) etName(); ari7=().getAddress(); private void setArNull() for(int i=0;i;i+) for(int j=0;jari.length;j+) arij=; etName(); ori3=().getPric

14、e(); ori4=().getDiscount(); ori5=().getPrice()*().getDiscount()*; ori6=(); ori7=(); private void setOrNull() for(int i=0;i;i+) for(int j=0;jori.length;j+) orij=; public static void main(String args) SellerFrame frame = new SellerFrame(); (true); package class UpdateFrame extends JFrame private stati

15、c final Goods Goods = null; private JLabel lbName = new JLabel(商品名:); private JLabel lbPrice = new JLabel(价格:); private JLabel lbDiscount = new JLabel(折扣:); private JLabel lbNum = new JLabel(数量:); private JTextField fieldName = new JTextField(20); private JTextField fieldPrice = new JTextField(20);

16、private JTextField fieldDiscount = new JTextField(20); private JTextField fieldNum = new JTextField(20); private JButton btSure = new JButton(修改); private JButton btCancel = new JButton(取消); private Goods goods = new Goods(); public UpdateFrame() init(); private void init() (320, 330); (修改商品信息); (ne

17、w ImageIcon(images/).getImage(); (null); (null); (false);/ ; (null); setText(goods); setContentPanel(); private void setContentPanel() (30, 30, 80, 30); (130, 30, 150, 30); (30, 90, 80, 30); (130, 90, 150, 30); (30, 150, 80, 30); (130, 150, 150, 30); (30, 200, 80, 30); (130, 200, 150, 30); (30, 250,

18、 70, 30); (210, 250, 70, 30); (lbName); (fieldName); (lbPrice); (fieldPrice); (lbDiscount); (fieldDiscount); (lbNum); (fieldNum); (btCancel); (btSure); (new ActionListener() Override public void actionPerformed(ActionEvent e) / TODO Auto-generated method stub setVisible(false); ); (new ActionListene

19、r() Override public void actionPerformed(ActionEvent e) / TODO Auto-generated method stub if(null, 您确定要修改吗)=0) GoodsDao dao = new GoodsDao(); (); (); (); (); (goods); setVisible(false); (null, 修改成功!); else / ); public void setText(Goods goods) (); (); (); (); public Goods getGoods() return goods; pu

20、blic void setGoods(Goods goods) = goods; public static void main(String args) UpdateFrame frame = new UpdateFrame(); (true); 数据库SQL语句:create table seller( seller_id varchar2(20) primary key, seller_name varchar2(20), pwd varchar2(20), address varchar2(200)insert into seller values(niclascage,长理专卖店,1

21、23456,湖南长沙)select * from sellerdrop table sellercommitcreate table buyer( buyer_id varchar(20) primary key, buyer_name varchar(20), pwd varchar2(20), address varchar(200)insert into buyer values(lina,林大专卖店,123456,湖南长沙)select * from buyerdrop table buyer create table goods( goods_id int primary key,

22、seller_id varchar(20), goods_name varchar(50), price int, discount int, num int, constraint fk_seller_id foreign key(seller_id) references seller(seller_id)insert into goods values(1,niclascage,Java,40,8,20)select * from goodsdrop table goods create table orders( order_id int primary key, goods_id i

23、nt, seller_id varchar(20), buyer_id varchar(20), num int, constraint fk_goods_id foreign key(goods_id) references goods(goods_id), constraint fk_sellers_id foreign key(seller_id) references seller(seller_id), constraint fk_buyer_id foreign key(buyer_id) references buyer(buyer_id)select * from ordersinsert into orders values(1,1,niclascage,lina,2)drop table orders;drop table goods;drop table buyer;drop table seller;

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2