In my project i have more than 30 JSP pages and for every page i have to connect to database...(some time there is a chance that i may change databases). and i dont want to touch my Business logic, can any one plz give me some coding so that i can write jdbc code once and retrive.
(i know there is some way where we will give class.forname & drivers manager path in Web.xml, if any one know's this plz give me code)
Joined: Mar 22, 2005
First off, keeping database code in JSPs is considered bad design - move any DB access code to Java code, e.g. a backing bean or a servlet. This page of the Tomcat documentation outlines how you can configure and use a connection pool in Tomcat.