Discussion:
java.sql.Connection and Statement
Ted Yu ted_yu-/E1597aS9LQAvxtiuMwx3w@public.gmane.org [seajug]
2014-06-17 17:51:22 UTC
Permalink
Hi,
A Statement is created from a Connection:
        Statement stmt = dbConn.createStatement();
If dbConn is closed, would resources for stmt be released as well ?

Thanks
Robert Kuhar robertkuhar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org [seajug]
2014-06-17 17:54:28 UTC
Permalink
Hello, Ted,

I think it depends on the driver implementation. If I read the docs
correctly, the JDBC API suggests that the resources that came out of the
Connection will be released by the Connection's close:
http://docs.oracle.com/javase/7/docs/api/java/sql/Connection.html#close()
Post by Ted Yu ted_yu-/***@public.gmane.org [seajug]
Hi,
Statement stmt = dbConn.createStatement();
If dbConn is closed, would resources for stmt be released as well ?
Thanks
Loading...