This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
You can work directly with a database from your JSPs but it is not recommended. Moving the database code out of your servlet and into a bean or some other Java class makes it much easier to test and re-use.
That being said, perform a Google search for "JDBC TUTORIAL" and you will find plenty of code samples.