The only way to find out for sure is to have a paternity test done. Are you planning on having an abortion if it's not your boyfriend's? In that case I don't know how long you have to be pregnant to get an accurate paternity test, so if that's influencing your decision, I don't know what to tell you. If I were you I would get the ex-boyfriend to do a paternity test. If it's not him, you know it's your boyfriend's and he never needs to know. If it is him, I guess it will be up to you what to do next.
It depends on when you ovulated.