Any class can access a datasource. You can create a Java bean that encapsulates your business logic, and then the servlet (or JSP) can access that bean.
In fact, I believe that the preferred architecture is to use JSPs mainly for doing UI stuff, with either no or minimal Java logic. The servlet then acts as a traffic cop, creating the appropriate beans based on the request, and calling the appropriate JSP for displaying the results.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com