I love having a few of these around in water & sometimes gravel but eventually, they always get tired of that. To save it, put it in a pot of soil like a regular houseplant and I think you'll be pleasantly surprised with the little clump that develops over the next couple of years. Whenever one gets too tall for your window, you can cut it off, cut it in half, and stick both pieces back into the pot (keeping the "up" end up.) As soon as you forget for a little while, roots will grow and then suddenly, a new stem coming up.
If you can water with rain water sometimes, that helps too, let it flush through the soil until a lot of water has come out of the drain hole. Dracaenas don't like fluoride.