title: Do MySQL Connections close automatically when the program exits?
body: <p>If I create a MySQL Connection in my java program, and the program exits from main method, what happens to this MySQL Connection?</p>
  
  <pre><code>public static void main(String args[])
  {
      Connection conn = getConnection(...);
  
      return;    
  }
  </code></pre>
  
  <p>Does this connection get closed automatically?</p>
  
  <p>Or does the connection stays alive until it times out?</p>