java - If connection is closed by a Database, do I need to close it manually? -


this question has answer here:

i have connection pool. in getconnection() method poll connection queue variable , check whether closed isclosed() method. if closed set variable new connection drivermanager.getconnection(url, user, password) method.

the question is: need close connection mannualy close() method before rewriting varible ensure connection collected garbage collector?

it not needed (recommended).

if call close() manually after connection has been closed, there no action performed on connection object.


Comments

Popular posts from this blog

javascript - ScrollTo Effect (href to div) -

javascript - ng-class not responding to change in model in Angular? -

javascript - document.registerElement extending HTMLInputElement prototype while using custom tag name to avoid implicit browser style -