title: how to check JDBC connection is live or closed Using try-with-resources?
body: <p>Once try-with-resources statement execution completion after how to check JDBC connection is live or closed ?</p>
  
  <p>Code :</p>
  
  <pre><code>try (Connection conn = ConnectionString.getConnection();
       PreparedStatement psmt = conn.prepareStatement(SQL_Queries.GET_PUBLISHER_ID_QUERY);
       ResultSet rs = psmt.executeQuery();)
  {
     psmt.setString(1, appId);
     while (rs.next()) {
       publisherId = rs.getString(Schema.PUBLISHER_PUBLISHID);
     }
  
     //System.out.println(conn != null ? "live" : "close");
  }
  </code></pre>