java实现图书管理系统 源码登陆账号:20170001 密码 111111调试步骤:1.在mysql 创建 library数据库2.执行 library.sql脚本3.修改如下数据库连接串为你本机信息 即可
package com.book.service;import com.book.dao.BookDao;import com.book.domain.Book;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.stereotype.Service;import java.util.ArrayList;@Servicepublic class BookService { private BookDao bookDao; @Autowired public void setBookDao(BookDao bookDao) { this.bookDao = bookDao; } public ArrayList<Book> queryBook(String searchWord){ return bookDao.queryBook(searchWord); } public ArrayList<Book> getAllBooks(){ return bookDao.getAllBooks(); } public int deleteBook(long bookId){ return bookDao.deleteBook(bookId); } public boolean matchBook(String searchWord){ return bookDao.matchBook(searchWord)>0; } public boolean addBook(Book book){ return bookDao.addBook(book)>0; } public Book getBook(Long bookId){ Book book=bookDao.getBook(bookId); return book; } public boolean editBook(Book book){ return bookDao.editBook(book)>0; }}
评论