Connecting to database logic
I need help to define the best approach to avoid connection jam.
I am writing some classes that read xml file, save to local disk, parse its contents, send receiving notification & insert the contents in oracle database. The xml file is sent over a network and I have a listener (servlet). Once the file is received, the process explained at the beginning starts. I open a new connection database, do whatever I want then close it. I am trying to think of another way so that I open the connection for certain time and then close it when it is not used after say 3 minutes. Is there any way to apply the logic or a better logic?
Highly appreciated,

