"I have immensely enjoyed my rugby career and especially the time that I have spent at Bath," he said.
"I was looking forward to fulfilling my playing contract with Bath till the end of next season but, after consultation with a medical specialist, I have been advised that it is no longer possible for me to continue to play.
"While it is extremely upsetting to be forced to end my playing career prematurely, I feel extremely fortunate to have been able to have run out at The Rec for the last 11 seasons and to have played alongside many great players in some truly memorable matches.
"I would like to thank everyone at Bath; the players, the coaches, the medical teams and all the staff, for making my time so enjoyable and especially the many supporters who ensure Bath remains a truly special club to be associated with."
Director of rugby Sir Ian McGeechan added.
"It is always sad when a player has to retire due to injury, especially one of David's caliber.
"He is not only a very good player on the pitch, but he adds many things to the Bath squad off the pitch, which we will miss next season.
"We would like to wish him well with all his future endeavours, and thank him for the many games he has played in the blue, black and white."