public boolean modifyBook(int id, Book book){
        if(id != 0){
            String sql = "update book set name=?, author1=?, author2=?, "
                    + "author3=?, isbn=?, state=? where id=?";
            try{
                PreparedStatement ps = con.prepareStatement(sql);
                ps.setString(1, book.getName());
                ps.setString(2, book.getAuthor1());
                ps.setString(3, book.getAuthor2());
                ps.setString(4, book.getAuthor3());
                ps.setString(5, book.getISBN());
                ps.setString(6, book.getState());
                ps.setInt(7, id);
                ps.executeUpdate();
                return true;
            }
            catch(SQLException ex){
                System.err.println(ex.getMessage());
                return false;
            }
        }
        else{
            return false;
        }
    }