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 - How to synchronize the Three.js and HTML/SVG coordinate systems (especially w.r.t. the y-axis)? -

javascript - How do I find how many occurences are there of a highlighted string, and which occurence is it? -

java - Reading data from multiple zip files and combining them to one -