-1
我怎麼能放棄這個while循環,聲明決裂也沒用〜我怎麼能退出while循環netbean
while(rs.next()) {
String uname=rs.getString("User_ID");
String password=rs.getString("User_PW");
String cusType=rs.getString("CUS_TYPE");
if ((user.equals(uname)) && (pwd.equals(password))){
if (cusType.equals("1")){
Account_Info_IND accountInfo = new Account_Info_IND();
accountInfo.setVisible(true);
this.dispose();
**BREAK;**
}
else {
Account_Info_COMP accountInfo1 = new Account_Info_COMP();
accountInfo1.setVisible(true);
this.dispose();
}
}
}
你的意思是:*陳述突破是無用*? – sstan
可能的原因'break'是沒用這裏,它不獲取調用。事實上,更好的解決方案將是建立一個更好的查詢 – MadProgrammer
我想退出while while循環時它滿足if語句的條件,所以我把一個「break」放在if語句中,但是系統說錯誤〜 – cyrus