Java login form with database connection

Posted by Muhammed Yoosuf on Stack Overflow See other posts from Stack Overflow or by Muhammed Yoosuf
Published on 2010-06-13T08:00:56Z Indexed on 2010/06/13 8:02 UTC
Read the original article Hit count: 318

Filed under:
|
|
|
|

I am creating a login form in java by having a database connection, and I need 2 open DIFFERENT forms for each user. However, all of the three forms open except for one. The forms I have are, MAinWindow Nursery Primary Secondary ALL THE FORMS OPEN except for the nursery form, when I enter the correct username it displays the Primary form. ANY HELP SOON

            char[] DBUserArray;
            DBUserArray=name.toCharArray();
            char [] DBPassArray;
            DBPassArray=pass.toCharArray();


            char AdminArray []=AdminUser.toCharArray();
            char NurArray []=NurHead.toCharArray();
            char[] PriArray =PriHead.toCharArray();
            char[] SecArray=SecHead.toCharArray();

            char[] input = txtpassword.getPassword();
            String user=txtusername.getText();
            char [] userString;
            userString=user.toCharArray();

        if(userString.length!=DBUserArray.length && input.length!=DBPassArray.length)

        {
           JOptionPane.showMessageDialog(null, "Username and Password Wrong","User Login",JOptionPane.ERROR_MESSAGE);
        }
        else
        {
             if(userString.length!=AdminArray.length)
            {
                if(userString.length!=PriArray.length)
                {
                    if(userString.length!=NurArray.length)
                    {
                        if(userString.length!=SecArray.length)
                        {

                        }
                        else
                        {
                            new Secondary().setVisible(true);
                            setVisible(false);
                        }
                    }
                    else
                    {
                        new Nursery().setVisible(true);
                        setVisible(false);
                    }
               }
               else
               {
                    new Primary().setVisible(true);
                    setVisible(false);
               }
             }
             else
             {
                 new MainWindow().setVisible(true);
                 setVisible(false);
             }
        }

© Stack Overflow or respective owner

Related posts about java

Related posts about database