This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I've edited your code to remove irrelevant details.
Please note: there is only one instance of a servlet created for each servlet mapping: your connection is being shared by *every* request that comes in; unless you can *guarantee* that only one person will *ever* use the application, you're heading towards a world of debugging pain. Servlets *must* be thread-safe. Also note that not closing the connection will cause serious issues as well.
Where does the error actually occur? If it says the file isn't there, it likely isn't there, or you don't have access to read it.
Joined: Sep 21, 2010
Thank you for the reply.
Ok so there are two issues now. Since im making these small codes and will later compile them all to make a big Web application.
1. How do i make it thread safe? So that every user that comes in gets his own DB connection. As there will be multiple users accessing the same servlet at the same time.
2. The file exists and i have the permissions to access it.