if(action.equalsIgnoreCase("newadmin")){
String fname = request.getParameter("fname");
String id = request.getParameter("adminid");
String email = request.getParameter("email");
String department = request.getParameter("department");
String password = request.getParameter("password");
AdminDAO admindao = new AdminDAO();
Admin admin = new Admin();
admin.setID(id);
admin.setName(fname);
admin.setEmail(email);
admin.setDepartment(department);
admin.setpassword(password);
int result = admindao.addAdmin(admin);
if(result == 1){
response.sendRedirect("./view-admin");
}
添加新管理员时,管理员id和部门不应相同。它应该显示id存在。这个查询是我在servlet中完成的。那么如何添加用户名查询?
暂无答案!
目前还没有任何答案,快来回答吧!