Log query and parameters when an SQLException was occured.