Although we always think of David as a king, he was also a prophet.
Since David's body did indeed see corruption when it became dust, he couldn't have been speaking about himself, but about the One who would succeed himthe Anointed One, the Messiah, the Christ.