A good place to start learning is, not only here, but at Sun's site. Do a search for JSP architecture, and you'll find some good examples/tutorials on the MVC (Model View Controller) architecture - which is a good framework to follow if you're developing web-based apps that utilitize a database.
Basically, you'll get the input from the user (username/password), forward this info to a JSP utility page, or
Java Servlet, which in turn contacts the database, looks up the user, the user's privileges, etc., and returns the info back to the client.
I usually have a Bean controlling the database utilities, and storing the user information. This way, you can easily model a user throughout the session simply by including the useBean tag:
WS