zoukankan      html  css  js  c++  java
  • 第二阶段:团队开发Fooks第三天

    今天考虑加入书架的个人化,首先对书架的后台数据格式进行了设计

    //加入书架
        public boolean addshelf(Bookshelf bookshelf){
            String sql="insert into Bookshelf(BookName,username) values(?,?)";
            Object obj[]= {bookshelf.getBookName(),bookshelf.getUsername()};
            return DBUtil.executeUpdate(sql,obj);
        }
        //从书架删除
        public boolean deleteshelf(Bookshelf bookshelf) {
            String sql="delete from Bookshelf where id=? and  BookName=? and username=? ";
            Object obj[]= {bookshelf.getId(),bookshelf.getBookName(),bookshelf.getUsername()};
            return DBUtil.executeUpdate(sql,obj);
        }
    View Code
    package entity;
    
    public class Bookshelf {
            private int id;
            private String BookName;
            private String username;
            
            public Bookshelf() {
            
            }
            public Bookshelf(String bookName, String username) {
                
                BookName = bookName;
                this.username = username;
            }
            public Bookshelf(int id, String bookName, String username) {
            
                this.id = id;
                BookName = bookName;
                this.username = username;
            }
            @Override
            public String toString() {
                return "Bookshelf [id=" + id + ", BookName=" + BookName + ", username=" + username + "]";
            }
            public int getId() {
                return id;
            }
            public void setId(int id) {
                this.id = id;
            }
            public String getBookName() {
                return BookName;
            }
            public void setBookName(String bookName) {
                BookName = bookName;
            }
            public String getUsername() {
                return username;
            }
            public void setUsername(String username) {
                this.username = username;
            }
            
    }
    Bookshelf.java

    明天对Android端进行重构,并实现与web的交互

  • 相关阅读:
    单例模式
    BeanFactory VS ApplicationContext
    java利用接口和适配器进行完全解耦参考《thinking in java》
    javascr*pt对象的创建相对java 怎样去创建了"类"*以及实例化对象
    实例化bean
    Spring AOP With AspectJ
    spring入门之环境搭建
    项目中ApplicationContext
    BeanFactory VS FactoryBean
    软开心法十四||软件改进
  • 原文地址:https://www.cnblogs.com/yeyueweiliang/p/12984610.html
Copyright © 2011-2022 走看看