Originally posted by Parmeet Sarpal:
At times I am getting the following error in my application - com.ibm.ejs.cm.pool.ConnectionWaitTimeoutException: Timeout waiting for free connection
I am using DataSource to connect to the oracle database. Ihave used this finally block to close the connection once its done. Is it necessary to close ResultSet and Statement objects also..??
Hi Parmeet,
it is very important that you close your Statement and ResultSet objects.
You can get into big time trouble not doing it, especially - and that is for sure - if you are using a connection pool. Closing a Connection obtained from a connection pool does NOT close the connection and release all used resources. Consequence is that you will have a memory leak.
This is a very common error in
JDBC programming.
Regards,
Taudo