On Mon, May 5, 2008 at 5:54 AM, David M. Lloyd <[EMAIL PROTECTED]> wrote: > On 05/03/2008 08:40 AM, Paulo Levi wrote: > > > Is it possible to make the java.sql interface Connection, Statement and > > ResultSet descend from closeable? > > > > Not that I'm aware of, since SQLException doesn't extend IOException. That > said, it might be nice to have a java.sql.Closeable for some future JDBC... > > I guess once you have that, you could do a java.lang.Closeable with a close > method that throws Exception, and derive both java.io.Closeable and > java.sql.Closeable from that. :-)
I think you want Closeable to be something like interface Closeable<X extends Exception> { void close() throws X; } Deciding how to do this is more of a Java SE specification issue than an OpenJDK implementation issue.