sql语句是这样写的String sql2="SELECT count(*) from 表名 where name='"+账号名+"'";
然后执行sql并判断
rs=stmt.executeQuery(sql2);
if(rs==null){
System.out.print("未注册");
addData();
}else{
System.out.print("已注册");
}
我这样判断是错的,因为没有注册过的账号都是已注册的。请问要怎么写才能正确检测有没有被注册呢