title: how can i quit a while loop netbean
body: <p>how can i quit this while loop , the statement break is useless~</p>
  
  <pre><code>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)) &amp;&amp; (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();
          }
      }
  
  
  }
  </code></pre>