Hello. I have a PreparedStatement/CallableStatement, a ResultSet and a Connection...
Now after execution finishes, i want to release my resources.
First I close my connection...
I also want to release my ResultSet and my PS
Will assigning null to my Connection object after closing the Connection object also assign null to my PS and ResultSet.
Do I need to assign null to my PS and RS.
myConnection.close();
myConnection = null;
myConnection.close();
myConnection = null;
myResultSet = null;
myPreparedStatement = null;
What is the difference between these two ?
Which is best for performance?
Does assigning null value to a connection also assigns null to PS and RS?
Will assigning null to the connection trigger the garbage collector?
Is code 2 better than code 1 when it comes releasing the resources?
Thanks...