I have this code to connect to a bd but the problem is that it does not enter the while loop
public static void conf(){
System.out.println("Ingrese serial");
String numSerial = sc.nextLine();
try{
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost/seriales","root","");
PreparedStatement ps = con.prepareStatement("SELECT usado FROM serial WHERE serial = ?");
ps.setString(1, numSerial);
ResultSet rs = ps.executeQuery();
while(rs.next()){
if(rs.equals(0)){
System.out.println("No usado");
}else if(rs.equals(1)){
System.out.println("Usado");
}
}
con.close();
}catch(Exception ex){
System.out.println(ex);
}
}
}
What can be the fault.