用户管理系统——查询所有用户

来源:互联网 发布:写c语言是用记事本么 编辑:程序博客网 时间:2024/05/18 02:46

cstm.dao

/** * 查询所有用户 */public List<Customer> findAll(){try {String sql="select * from t_customer";return qr.query(sql, new BeanListHandler<Customer>(Customer.class));} catch (SQLException e) {// TODO Auto-generated catch blockthrow new RuntimeException(e);}}

cstm.service

public List<Customer> findAll(){return customerDao.findAll();}
cstm.servlet
public String findAll(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException {List<Customer> list=customerService.findAll();request.setAttribute("cstmList", list);return "f:/list.jsp";}




0 0