sleepingSatellite
Programmer
I have a JSP application. JSP must get data from a DB. The access to DB is performed through a bean, which instantiates the connection and execute the queries.
The problem is that in order to access the DB, I need user and password, and I want these to be stored in web.xml (I use Tomcat).
Does it mean that everytime The JSP needs to access the DB it must pass to the bean the application object so that the bean can access web.xml, get the password and access the DB ?
CAN'T THE BEAN ACCESS DIRECTLY WEB.XML ? CAN'T I AVOID TO PASS application TO THE BEAN EVERYTIME ?
Thank you.
The problem is that in order to access the DB, I need user and password, and I want these to be stored in web.xml (I use Tomcat).
Does it mean that everytime The JSP needs to access the DB it must pass to the bean the application object so that the bean can access web.xml, get the password and access the DB ?
CAN'T THE BEAN ACCESS DIRECTLY WEB.XML ? CAN'T I AVOID TO PASS application TO THE BEAN EVERYTIME ?
Thank you.