D.K.
It has become a habit not out of need. Do not cave in and just let it go, if he asks, say no not tonight and walk out of the room. Do not give in even if he pitches a fit. A child doesn't need at that age to drink in the middle of the night not to mention it will totally ruin potty training down the road. Just start by saying he can have it when he gets up but no more water at night. A child can condition themself to continue to wake if the habit has formed, which it has. To get him to sleep through the night, you have to eliminate the water.