In my project a servlet has to connect to database (derby).I build my project into .war file.
Now before deploying the project in Tomcat , how do i tell the server the URL of the databsae,JNDI name,driverName etc etc. How do i do this ? I was told to add these into the context.xml file. Do i have to create this file myself ? Otherwise there is also a context.xml file in the conf directory of tomcat. I have to deploy one more project that also needs to connect to the database but has a different URL. So i think i can’t add the details in the context.xml file in conf directory.
How do i deploy these two projects ? Do i need to make 2 different context.xml files ?
Put the configuration in a context.xml and put that file in the META-INF folder of your war. See tomcat context documentation on the tomcat website.