JDBC: Does the connection break if i lose reference to the Connection object?

Posted by wretrOvian on Stack Overflow See other posts from Stack Overflow or by wretrOvian
Published on 2010-06-06T09:15:44Z Indexed on 2010/06/06 9:22 UTC
Read the original article Hit count: 152

Filed under:
|
|

Hi.

If i have the following method -

public static void C()  {
    Connection con = DriverManager.getConnection();

    .... // code

    return;
}

and i dont call con.close() , will the connection terminate automatically once the method returns?

© Stack Overflow or respective owner

Related posts about java

Related posts about sql