public boolean insert(DepartmentUser departmentUser) { boolean flag = false; DBUtil dbUtil = new DBUtil(); String sql = "insert into 教师表 values('"+ departmentUser.getDeptID() + "'," + departmentUser.getUserName() + "', " + departmentUser.getUserSex() + "'," + departmentUser.getUserAddress() + "', " + departmentUser.getUserPhoneID() + "'," + departmentUser.getUserAge() + "'," + departmentUser.getUserPwd() + "' " + departmentUser.getUserID()+ "')"; System.out.println(sql); int n = dbUtil.update(sql); if(n != 1) { flag = false; } else { flag = true; } dbUtil.close(); return flag;
<%
Test test = new Test();
test.insert(user);
%>
Test test = new Test();
test.insert(user);
%>
温馨提示:答案为网友推荐,仅供参考