title: Connection close
body: <p>Have a method getConnection() to initialize a connection. I know, that I can use </p>
  
  <pre><code>try (Connection conn = getConnection()) {
      ...
      Target t = new Target(conn);
      ...
  }
  </code></pre>
  
  <p>in Java 7 to work with that connection and automatically close it at the end of the try. But what happens if I just use the following code without a try:</p>
  
  <pre><code>Target t = new Target(getConnection());
  </code></pre>
  
  <p>Does that create a resource leak because I can not close the connection because I have do not hava a variable for the connection? </p>