Moving to servlets for now.
What *exactly* you need to do depends on your requirements, your environment, what you already have, etc. We wouldn't tell you *exactly* what to do anyway, because JavaRanch is
NotACodeMill :) But you already seem to know you need to check credentials against a database--what else do you need to know?