This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
It's good to move database access into a set of classes that are separate from JSPs. This kind of thing is common and is sometimes called MVC2:
The Servlet acts as a controller. It pulls data out of the HttpRequest and figures out what POJO to call. A "Plain Old Java Object" is not part of any framework, and I like them to have no J2EE imports at all - no session or request or response. The POJO can read or write databases or whatever it needs to do and return data for the next page. The controller forwards to a JSP which formats the response and does nothing else.
Does that make sense?
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi