log sql statement that caused SQLException