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

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -