Verbose logging for PreparedStatements

This commit is contained in:
Ammar Askar
2015-02-08 16:34:46 +05:00
parent d7f2ac5a65
commit 6e12d159b4

View File

@@ -508,7 +508,15 @@ public class Consumer extends TimerTask
ps.executeUpdate(); ps.executeUpdate();
} }
} }
// we intentionally do not catch SQLException, it is thrown to the caller catch (final SQLException ex) {
if (ps1 != null) {
getLogger().log(Level.SEVERE, "[Consumer] Troublesome query: " + ps1.toString());
}
if (ps != null) {
getLogger().log(Level.SEVERE, "[Consumer] Troublesome query: " + ps.toString());
}
throw ex;
}
finally { finally {
// individual try/catch here, though ugly, prevents resource leaks // individual try/catch here, though ugly, prevents resource leaks
if( ps1 != null ) { if( ps1 != null ) {