
http://www.nextree.co.kr/p3239/
IOException, SQLException, ...예외 처리 방법
void checkedExceptionExample() {
try {
File f = File.createTempFile("test", "dd");
} catch (IOException e) {
// send error log
// ...
} finally {
// 예외 여부 상관없이 실행 (e.g. file.close, dbconnection.close)
}
}
void checkedExceptionExample() throw IOException {
File f = File.createTempFile("aa", "bb");
}
catch(SQLException e) {
...
throw DuplicateUserIdException();
}