如果发生异常,try-with-resources 会关闭所有打开的资源吗?
private void insertUserInAccessTable(int user_id) throws SQLException {
final String sql = "bla bla";
try( Connection con = ...; PreparedStatement ps = ... ) {
...
if(i==0) throw new SQLException();
}
}