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
-~----------~----~----~----~------~----~------~--~---