• 第二阶段:团队开发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的交互

  • 相关阅读:
    Linux的学习--系统目录
    PHP内核的学习--创建PHP扩展
    PHP的学习--连接MySQL的三种方式
    MIME Type
    颜色的命名
    JavaScript的学习--生成二维码
    MySQL的学习--触发器
    Google Guava之--cache
    java代码调用oracle存储过程
    oracle序列
  • 原文地址:https://www.cnblogs.com/yeyueweiliang/p/12984610.html
Copyright © 2020-2023  润新知