Is it ok to just set a connection object to null? like conn=null, instead of using conn.close() ? An application was turned over to me and it's having null pointer exceptions with it's connection objects. The error is very intermittent though, so i thought the number connections is getting over the limit of the maximum number of connections set...
You do have to close a connection when you are finished using it. Doing that in the "finally" part of a try-catch-finally block is the most reliable way of making sure it happens.
As for assigning null to variables, that's almost always pointless. The only place you really have to do that is when the variable refers to a very large object, and you don't need the object any more, and you want to make it available for garbage collection. A JDBC Collection is not a large object.
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads