Postgresql Find Duplicate Values In Java