次のコードスニペットでは、
try
{
Statement stmt = conect.getConnection();
stmt.executeUpdate(query);
}
catch(SQLException e)
{
//handle exception
}
finally
{
try{ stmt.close(); }
catch(SQLException ignore){}
}
stmt.close();の実行中にfinallyブロックで例外が発生するとどうなりますか。この種の問題を処理するためのより良い方法はありますか?