And of course beluga whales have been kept in captivity, successfully, for a long long time.
There is a real trade off here, IMO. I think that the close up encounters that aquariums and zoos allow are worth the risk that some animals ***MAY*** die sooner than they would in the wild. In many of these cases, we may not know if they would have died sooner...or if the fact that they are given lots of care may have extended their lives. Regardless of what people believe, mother nature can be pretty harsh...an animal with a disease will likely not survive near as long in the wild. Even in real life they may not, due to competition. A weak whale in captivity will be medicated and fed - a weak whale in the wild will likely die from inability to eat enough.
Anyway, I think there is a benefit to people having up close experiences with these animals because they can be used to draw attention to the plight of those that may be endangered. There is no doubt, IMO, that the popularity of dolphins is largely due to flipper, and the familiarity in aquariums.
We must hope that they may be able to do the same for sharks, which have a much more negative view (and Jaws did not help them).