Name: jl125535 Date: 09/22/2004
A DESCRIPTION OF THE REQUEST :
Finally the classes in java.io have implemented a Closeable interface, so you can write one close method that takes a Closeable argument. I have waiting for this feature to be added for a long time, and it made me glad when I saw that the interface was added to JDK 1.5. But to my disappointment the interface wasn't also added to the java.sql package.
In short. Let the interfaces
extend a Closeable interface.
The close method in the Closeable interface in the java.io package declares that it throws an IOException, so it can't be used. You could either make IOException and SQLException extend/implement a common base, and alter the Closeable interface so it declares that the close method throws that common base, or duplicate the interface, and place it in java.sql package as well. I guess there are other ways to solve it as well.
As it is now we have to write close methods that are overloaded with different arguments.
I would like to be able to write one close method that can close statements, result sets and connections.
(Incident Review ID: 311502)