Ram,
It is driver dependent. You may check the driver documentation. Info should be there if closing connection closes Statement and Resultsets created with this connection, too.
You can't rely on finalizer method. You don't know when it will run. I've read in Ted Newards Effective Enterprise
Java that in a gc cycle not all objects eligible for garbage collection are really garbage collected.
Some small objects might remain in memory. This has to do with optimization of garbage collector process. And from the VM standpoint ResultSets and Statements might be small object, cause they are thin wrappers around C++-objects (dependant on type of driver). No garbage collection, no finalizer call. So ResultSets and Statements stay open, which is not good.
You have basically the same issue with swt-objects or LotusDomino objects. You have to close them explicitly, too. They are JNI-wrappers around C/C++ functionality also. Both provide functionality to close/invalidate the objects created with the one whose close method you call.
this is at least how I understand it. Correct me if I am wrong.
Axel
[ February 02, 2005: Message edited by: Axel Janssen ]