Updated DatabaseException to provide the SQL statement that caused the error when exception is raised as a result of a query