Explain try-with-resources and suppressed exceptions.

try (Connection c = ds.getConnection(); PreparedStatement ps = c.prepareStatement(sql)) { ... } — both closed even on SQLException. Check e.getSuppressed()...

Explain try-with-resources and suppressed exceptions. · Home · Support the platform