资源简介

java图书管理系统,详细的内容可以参考https://blog.csdn.net/qq_36744683/article/details/85460702

资源截图

代码片段和文件信息

package com.action;

import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForm;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForward;
import com.actionForm.BookForm;
import org.apache.struts.action.Action;
import com.dao.BookDAO;
import java.util.Date;

public class Book extends Action {
    private BookDAO bookDAO = null;
    public Book() {
        this.bookDAO = new BookDAO();
    }

    public ActionForward execute(ActionMapping mapping ActionForm form
                                 HttpServletRequest request
                                 HttpServletResponse response) {
        String action =request.getParameter(“action“);
        System.out.println(“\nbook*********************action=“+action);
        if(action==null||““.equals(action)){
            request.setAttribute(“error““您的操作有误!“);
            return mapping.findForward(“error“);
        }else if(“bookAdd“.equals(action)){
            return bookAdd(mappingformrequestresponse);
        }else if(“bookQuery“.equals(action)){
            return bookQuery(mappingformrequestresponse);
        }else if(“bookModifyQuery“.equals(action)){
            return bookModifyQuery(mappingformrequestresponse);
        }else if(“bookModify“.equals(action)){
            return bookModify(mappingformrequestresponse);
        }else if(“bookDel“.equals(action)){
            return bookDel(mappingformrequestresponse);
        }else if(“bookDetail“.equals(action)){
            return bookDetail(mappingformrequestresponse);
        }else if(“bookifQuery“.equals(action)){
            return bookifQuery(mappingformrequestresponse);
        }
        request.setAttribute(“error““操作失败!“);
        return mapping.findForward(“error“);
    }
    /***********************添加图书信息**************************/
    private ActionForward bookAdd(ActionMapping mapping ActionForm form
                              HttpServletRequest request
                              HttpServletResponse response){
           BookForm bookForm = (BookForm) form;
           bookForm.setBarcode(bookForm.getBarcode());
           bookForm.setBookName(bookForm.getBookName());
           bookForm.setTypeId(bookForm.getTypeId());
           bookForm.setAuthor(bookForm.getAuthor());
           bookForm.setTranslator(bookForm.getTranslator());
           bookForm.setIsbn(bookForm.getIsbn());
           bookForm.setPrice(bookForm.getPrice());
           bookForm.setPage(bookForm.getPage());
           bookForm.setBookcaseid(bookForm.getBookcaseid());    
           //获取系统日期
           Date date1=new Date();
           java.sql.Date date=new java.sql.Date(date1.getTime());
           bookForm.setInTime(date.toString());
           bookForm.setOperator(bookForm.getOperator());
           int a=bookDAO.insert(bookForm);
           if(a==1){

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-12-31 13:21  JspLibrary\
     文件         838  2018-12-25 09:13  JspLibrary\.classpath
     文件        1259  2018-12-24 11:29  JspLibrary\.project
     目录           0  2018-12-30 13:28  JspLibrary\.settings\
     文件         503  2013-05-02 22:58  JspLibrary\.settings\.jsdtscope
     文件         395  2013-05-02 22:58  JspLibrary\.settings\org.eclipse.jdt.core.prefs
     文件         460  2013-05-02 22:58  JspLibrary\.settings\org.eclipse.wst.common.component
     文件         345  2013-05-02 22:58  JspLibrary\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2013-05-02 22:58  JspLibrary\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2013-05-02 22:58  JspLibrary\.settings\org.eclipse.wst.jsdt.ui.superType.name
     目录           0  2018-12-30 13:28  JspLibrary\build\
     目录           0  2018-12-30 13:28  JspLibrary\build\classes\
     目录           0  2018-12-30 13:28  JspLibrary\build\classes\com\
     目录           0  2018-12-30 13:28  JspLibrary\build\classes\com\action\
     目录           0  2018-12-30 13:28  JspLibrary\build\classes\com\actionForm\
     文件         811  2018-12-25 09:13  JspLibrary\build\classes\com\actionForm\BookCaseForm.class
     文件        3752  2018-12-25 09:13  JspLibrary\build\classes\com\actionForm\BookForm.class
     文件        1018  2018-12-25 09:13  JspLibrary\build\classes\com\actionForm\BookTypeForm.class
     文件        4957  2018-12-25 09:13  JspLibrary\build\classes\com\actionForm\BorrowForm.class
     文件        2151  2018-12-25 09:13  JspLibrary\build\classes\com\actionForm\LibraryForm.class
     文件        2094  2018-12-25 09:13  JspLibrary\build\classes\com\actionForm\ManagerForm.class
     文件         957  2018-12-25 09:13  JspLibrary\build\classes\com\actionForm\ParameterForm.class
     文件        1278  2018-12-25 09:13  JspLibrary\build\classes\com\actionForm\PublishingForm.class
     文件        3484  2018-12-25 09:13  JspLibrary\build\classes\com\actionForm\ReaderForm.class
     文件        1022  2018-12-25 09:13  JspLibrary\build\classes\com\actionForm\ReaderTypeForm.class
     文件        5628  2018-12-25 09:13  JspLibrary\build\classes\com\action\Book.class
     文件        3890  2018-12-25 09:13  JspLibrary\build\classes\com\action\BookCase.class
     文件        3978  2018-12-25 09:13  JspLibrary\build\classes\com\action\BookType.class
     文件        6222  2018-12-25 09:13  JspLibrary\build\classes\com\action\Borrow.class
     文件        2823  2018-12-25 09:13  JspLibrary\build\classes\com\action\Library.class
     文件        5765  2018-12-25 09:13  JspLibrary\build\classes\com\action\Manager.class
............此处省略150个文件信息

评论

共有 条评论