camera bodies will change, 2 years you might find a revision of the current model you buy (D300 vs D300s for example) but all in all, that is bound to happen. your only course of action to avoid that road and to have a camera that lasts you through this generation and maybe even the next (depending on your skill and mastering of your camera) is to invest well in your body (D90-range at the least for example).
its the lens that will last you through the bodies and its the lens that greatly improve what you can deliver, but remember, its you, the photographer that makes the good images not the camera. even today you can still see images taken on a D70/D80 that can compare in quality to current gen cameras - it all depends on who's holding the tools.
p.s. i use Nikon examples cause thats the system im most familiar with.