int i=0;String sql = "select * from administrator whre name = ?; pstmt = conn.prepareStatement(sql); pstmt.setString(1, Name);ResultSet re = pstmt .executeQuery();while(re.next()){ i++;}if(i>0){out.print(“该用户已经被注册”);}