毕业论文论文范文课程设计实践报告法律论文英语论文教学论文医学论文农学论文艺术论文行政论文管理论文计算机安全
您现在的位置: 毕业论文 >> 论文 >> 正文

电子商务毕业论文 第13页

更新时间:2009-3-9:  来源:毕业论文

CD在线商店销售系统设计
  cdlist = new Vector(rscount);
              while (rs.next()){
                                cd cd = new cd();
                                cd.setId(rs.getLong("id"));
                                cd.setcdName(rs.getString("cdname"));
                                cd.setcdClass(rs.getInt("cdclass"));
                                cd.setClassname(rs.getString("classname"));
                                cd.setSinger(rs.getString("Singer"));
                                cd.setPublish(rs.getString("publish"));
                                cd.setcdNo(rs.getString("cdno"));
                                cd.setmusiclist(rs.getString("musiclist"));
                                cd.setPrice(rs.getFloat("Price"));
                                cd.setAmount(rs.getInt("amount"));
                                cd.setLeav_number(rs.getInt("leav_number"));
                                cd.setRegTime(rs.getString("regtime"));
                                cd.setPicture(rs.getString("picture"));
                                cdlist.addElement(cd);
                        }
                        close();
                        return true;
                }catch (Exception e){
                        System.out.println(e.getMessage());
                        return false;
                }
        }
        /**
         * 完成CD添加
         * @return
         * @throws java.lang.Exception
         */
 public boolean insert() throws Exception {
  sqlStr = "insert into cd (cdname,cdclass,Singer,Publish,cdno,"+
           "musiclist,Price,Amount,Leav_number,Regtime,picture) values ('";
           sqlStr = sqlStr + dataFormat.toSql(acds.getcdName()) + "','";
           sqlStr = sqlStr + acds.getcdClass() + "','";
           sqlStr = sqlStr + dataFormat.toSql(acds.getSinger()) + "','";
           sqlStr = sqlStr + dataFormat.toSql(acds.getPublish()) + "','";
           sqlStr = sqlStr + dataFormat.toSql(acds.getcdNo()) + "','";
           sqlStr = sqlStr + dataFormat.toSql(acds.getmusiclist()) + "','";
           sqlStr = sqlStr + acds.getPrice() + "','";
           sqlStr = sqlStr + acds.getAmount() + "','";
           sqlStr = sqlStr + acds.getAmount() + "',";
           sqlStr = sqlStr + "GETDATE()"+ ",'";
           sqlStr = sqlStr + acds.getPicture()+"')";
                try{
                        System.out.print(sqlStr);
                        DataBase db = new DataBase();
                        db.connect();
                        stmt =db.conn.createStatement ();
                        stmt.execute(sqlStr);
                        return true;
                }catch (SQLException sqle){
                  System.out.print(sqle.getMessage());
                        return false;
                }
        }
        /**
         * 完成CD修改
         * @return
         * @throws java.lang.Exception
         */
public boolean update() throws Exception {
  sqlStr = "update cd set ";
  sqlStr = sqlStr + "cdname = '" + dataFormat.toSql(acds.getcdName()) + "',";
  sqlStr = sqlStr + "cdclass = '" + acds.getcdClass() + "',";
  sqlStr = sqlStr + "Singer = '" + dataFormat.toSql(acds.getSinger()) + "',";
  sqlStr = sqlStr + "publish = '" + dataFormat.toSql(acds.getPublish()) + "',";
  sqlStr = sqlStr + "cdno = '" + dataFormat.toSql(acds.getcdNo()) + "',";
  sqlStr = sqlStr + "musiclist = '" + dataFormat.toSql(acds.getmusiclist()) + "',";
  sqlStr = sqlStr + "Price = '" + acds.getPrice() + "',";
  sqlStr = sqlStr + "Amount = '" + acds.getAmount() + "',";
  sqlStr = sqlStr + "picture = '" + acds.getPicture() + "' ";
  sqlStr = sqlStr + "where id = " + acds.getId();
                try{
                        DataBase db = new DataBase();
                        db.connect();
                        stmt =db.conn.createStatement ();
                        stmt.execute(sqlStr);
                        return true;
                } catch (SQLException e){
                        System.out.print(e.getMessage());
                        return false;
                }

        }
        /**
         * 完成CD删除
         * @param aid
         * @return
         * @throws java.lang.Exception
         */
        public boolean delete( int aid ) throws Exception {
                sqlStr = "delete from cd where id = "  + aid ;
                try
                {         DataBase db = new DataBase();
                          db.connect();
                          stmt =db.conn.createStatement ();
                          stmt.execute(sqlStr);
                         return true;
                }
                catch (SQLException e)
                {
                        System.out.println(e);
                        return false;
                }
              }
              /**
               * 完成CD单本查询,用于支持页面的查看CD详细资料
               * @param newid
               * @return
               * @throws java.lang.Exception
               */
 public boolean getOnecd(int newid ) throws Exception {
     DataBase db = new DataBase();
     db.connect();
     stmt =db.conn.createStatement ();
     try {
        sqlStr="select  a.id,a.cdname,a.cdclass,b.classname,a.Singer,"+
        "a.publish,a.cdno,a.musiclist,a.Price,a.amount,a.Leav_number,"+
        "a.regtime,a.picture from cd a,cdclass b where a.cdclass="+
        "b.Id and a.Id = " + newid ;
                        rs = stmt.executeQuery(sqlStr);
                        if (rs.next())
                        { cdlist = new Vector(1);
                                cd cd = new cd();
                                cd.setId(rs.getLong("id"));
                                cd.setcdName(rs.getString("cdname"));
                                cd.setcdClass(rs.getInt("cdclass"));
                                cd.setClassname(rs.getString("classname"));
                                cd.setSinger(rs.getString("Singer"));
                                cd.setPublish(rs.getString("publish"));
                                cd.setcdNo(rs.getString("cdno"));
                                cd.setmusiclist(rs.getString("musiclist"));
                                cd.setPrice(rs.getFloat("Price"));
                                cd.setAmount(rs.getInt("amount"));
                                cd.setLeav_number(rs.getInt("leav_number"));
                                cd.setRegTime(rs.getString("regtime"));
                                cd.setPicture(rs.getString("picture"));
                                cdlist.addElement(cd);
                        } else {
                                close();
                                return false;
                        }
                        close();
                        return true;
                }
                catch (SQLException e)
                {
                        return false;
                }
        }
        public int getPage() {    //显示的页码
                return page;
        }
        public void setPage(int newpage) {
                page = newpage;
        }
        public int getPageSize(){   //每页显示的CD数
                return pageSize;
        }

 << 上一页  [11] [12] [13] [14] [15] [16] [17] [18] [19] 下一页

电子商务毕业论文 第13页下载如图片无法显示或论文不完整,请联系qq752018766
设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©751com.cn 辣文论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。