Properly catches SQLException