} if(rs!=null){ rs.close(); } close(stat,conn); return result; }
//条件查询跳转
public void dispatch(HttpServletRequest request, HttpServletResponse response) throws ClassNotFoundException, SQLException, ServletException, IOException{ String id5=request.getParameter(\ String name5=request.getParameter(\ if(select(id5,name5).isEmpty()){ request.getRequestDispatcher(\ } else{ request.setAttribute(\
request.getRequestDispatcher(\ } }
//设置分页相关参数方法 public Page setpage(HttpServletRequest request, HttpServletResponse response) throws ClassNotFoundException, SQLException{ String crd=request.getParameter(\ //String id=request.getParameter(\
// String name=request.getParameter(\ ArrayList
pager.setCurrentPage(currentRecord,pager.getPageSize()); } return pager; } //获得分页显示的子集 public void difpage(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, ClassNotFoundException, SQLException{ // String id=request.getParameter(\ // String name=request.getParameter(\ ArrayList
Page pager=new Page(); pager=setpage(request,response); List
int currentRecord=pager.getCurrentRecord(); if(currentRecord==0){
if(pager.getTotalRecord()<8){ subResult=(List
else if(pager.getCurrentRecord()+pager.getPageSize() subResult=(List result.subList(pager.getCurrentRecord(),pager.getCurrentRecord()+pager.getPageSize()); } else { subResult=(List request.setAttribute(\ request.setAttribute(\ request.getRequestDispatcher(\ } //信息删除方法 public void delete(HttpServletRequest request, HttpServletResponse response) throws ClassNotFoundException, SQLException, ServletException, IOException{ Connection conn=null; Statement stat=null; conn=connect(); stat=conn.createStatement(); String id2=request.getParameter(\ stat.execute(\ request.getRequestDispatcher(\ } //信息修改方法 public void update1(HttpServletRequest request, HttpServletResponse response) throws ClassNotFoundException, SQLException, ServletException, IOException{ String id4=request.getParameter(\ request.setAttribute(\ request.getRequestDispatcher(\ } public void update(HttpServletRequest request, HttpServletResponse response) throws ClassNotFoundException, SQLException, ServletException, IOException{ Connection conn=null; Statement stat=null; String id3=request.getParameter(\ String name3=request.getParameter(\ String age3=request.getParameter(\ String gender3=request.getParameter(\ String major3=request.getParameter(\ conn=connect(); stat=conn.createStatement(); stat.execute(\student set id=\where id=\ request.setAttribute(\ request.getRequestDispatcher(\ } } 10,在webRoot目录下添加以下.jsp文件 10.1 putin.jsp <%@ page language=\<% String path = request.getContextPath(); String basePath = request.getScheme()+\%>