The idea is that the carbonite put's him into a state of hibernation, IE slows down his metabolism enough so the his body burns very little energy. So he can survive for a long time without eating or drinking, just like a bear, which hibernates for several months and doesn't eat or drink. So remarkable as it is it does happen!
Actually I would have thought the first thing he would want to do when he was released was visit the bathroom...