In Scala you get the Either type. That is superior for most cases where one might use checked exceptions in Java.
I have used that style in Java, but you usually don't make friends with it. Peter Michael Neale wrote: > What do people think of the scala approach of no checked exceptions - > even checked exceptions are not treated specially by the constructor > (personally, I like it). > > > > On Aug 18, 12:55 pm, Christian Catchpole <[email protected]> > wrote: > >> No, i just let that go up. I really try to avoid the declare as null >> then set thingy. >> >> On Aug 18, 12:03 pm, Casper Bang <[email protected]> wrote: >> >> >> >> >>> You neglect to handle the checked exception declared by >>> prepareStatement no? >>> >>> PreparedStatement stmt = null; >>> try{ >>> stmt = connection.prepareStatement(sql); >>> final ResultSet rs = stmt.executeQuery(); >>> try{ >>> while (rs.next()){ >>> // Stuff... >>> { >>> } >>> finally{ >>> rs.close(); >>> }} >>> >>> catch(SQLException e){ >>> // Logging...} >>> >>> finally{ >>> try{ >>> stmt.close(); >>> } >>> catch(SQLException whoTheFuckCares){ >>> }; >>> >>> } >>> >>> Really, how many other ways are there to do it I wonder now? (Apart >>> from wrapping certain things, like the last try-catch clause in some >>> general purpose "closer util"?). >>> >>> /Casper >>> > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/javaposse?hl=en -~----------~----~----~----~------~----~------~--~---
