Before becoming district attorney , Mr. Spota practiced law for nearly two decades in Hauppauge , mainly defending people and businesses in personal injury lawsuits , though he also represented law enforcement unions in Suffolk County .