private void loginSubmitButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_loginSubmitButtonActionPerformed
        // TODO add your handling code here:
        String userName = userNameText.getText();
        String password = passwordText.getText();
        Boolean accountAvailable = false;
        int accountID = 0;
        int permission = 0;
        String accountPassword = "";
        String firstName = "";
        String lastName = "";
        
        DatabaseConnection dbConnect = new DatabaseConnection();
        Connection conn = dbConnect.connectToDB();
        
        // Query to see if account exists
        String sql = "SELECT COUNT(Username) as accountAvailable FROM `HD_Accounts` WHERE Username = '"+userName+"'"; 
        ResultSet rs = dbConnect.getResults(conn, sql);
        try {
            if (rs.next())
            {
                if(rs.getInt("accountAvailable") == 1)
                { 
                    accountAvailable = true;

                    sql = "SELECT * FROM `HD_Accounts` where Username = '"+userName+"'";
                    rs = dbConnect.getResults(conn, sql);

                    while(rs.next()){
                    //Retrieve by column name
                        accountID  = rs.getInt("id");
                        accountPassword = rs.getString("Password");
                        firstName = rs.getString("FirstName");
                        lastName = rs.getString("LastName");
                        permission = rs.getInt("Permission") + 1;
                    }

                }
            }
        } catch (SQLException ex) {
            Logger.getLogger(HelpDeskMainFrame.class.getName()).log(Level.SEVERE, null, ex);
        }
                    
        
        
        
        
        if (!accountAvailable && !accountPassword.equals(password))
        {
            failure++;
            if (failure == 3)
            {
                this.dispose();
                failureAlert.setVisible(true);
            }
            else
            {
                softFailureAlert.setVisible(true);
                userNameText.setText("");
                passwordText.setText("");
            }
        }
        else
        {
            this.dispose();
            new LandingForm(permission, accountID).setVisible(true);
        }
}//GEN-LAST:event_loginSubmitButtonActionPerformed