?
//在数据库中检测用户名是否唯一
?
public boolean checkUsername(String username) throws Exception{ boolean flag = false; String sql = "select * from user where username=?" ; QueryRunner runner = new QueryRunner(WebUtil.getDataSource()); User user = runner.query(sql,new BeanHandler(User.class ),username); //在数据库中没有改用户名 if(user == null){ flag = true; } return flag; }?