Where does the energy stored in glucose come from?

The energy stored in glucose comes from the sun. Plants use photosynthesis to convert sunlight into chemical energy, which is then stored in the form of glucose molecules.