Re: Help in Java Website.
Please don't solicit off-forum communication, as that defeats the very purpose of a forum, which is to share problems and their possible solutions.
db
Re: Help in Java Website.
1. Just SELECT for the database using the username in the WHERE clause. Write a method that simply does that and returns true or false - public boolean userExists(String username). Of course you could simply try and create the user using that name and the database should throw an exception (duplicate key) assuming you have the username down as a primary key, or at least marked as UNIQUE if you are using an id as the primary key.
2. Just have a flag on the account which says whether it is an admin account or not. Do not allow the creation of admin accounts through the normal front end (assuming it is customer facing). Only allow another admin account to add an admin account, that way Joe Bloggs should not be able to add an admin account. This does mean you need a bootstrap admin account. The other option is to simply not allow the creation of admin accounts through that site (which is more normal). They would be created using some internal app.
3. This would involve having a decent database model, which you;re not likely to get anyone here suggesting, and lots of SQL querying.
4. Database again.