Java program for validating username and password

Finally a separate method would call the validation routine and then generate the appropriate * from log; ---------- ---------- | username | password | ---------- ---------- | Razmy | 100 | | Raza | 200 | | Jhone | 300 | | Jay | 400 | | Jennifer | 500 | ---------- ---------- 5 rows in set (0.00 sec) I wrote a Java class to check the username and the password from the database. A password must contain at least two digits Input a password (You are agreeing to the above Terms and Conditions.): abcd1234 Password is valid: abcd1234 Flowchart: Java Code Editor: Contribute your code and comments through Disqus.I just wrote this password validation code function that checks to see if a password will be accepted in AD or not.Write a Java method to check whether a string is a valid password.

Then a couple of hints: To compare Strings you can't use == (even less =, which is assignment).

New users get added to a file and I have to validate usernames and passwords from that same file. It is very difficult to read and fully understand so much code that has no description. If the code is not functioning as you'd like, post examples of what you want it to do and actual results from running the code that show how it does not agree with your specification, cut and past if possible.

Please describe it in detail - tell what the classes do, basic logic of methods etc. Since the assignment requires a file of customer usernames and passwords, you need to define the format of the file and then read it into a collection of some kind.

This is a security issue and could be a severe security issue.

If you needed some output, you could use Besides all the other useful answers, I would suggest splitting up the password validation from the HTML generation.

Leave a Reply