这就是我想要做的:
try {
//code
} catch (Exception e) {
return false;
} finally {
//close resources
}
这行得通吗?这是不好的做法吗?这样做会更好吗:
boolean inserted = true;
try {
//code
} catch (Exception e) {
inserted = false;
} finally {
//close resources
}
return inserted;