I want to do ekashna, then can I do it even if I had water at 3 am in the morning
In Jainism, ekashana refers to the practice of taking only one meal in a day, often as a form of spiritual discipline and self-control. According to Jain traditions, especially among Shwetambar and Digambar communities, ekashana usually means that between sunrise and sunset, only one sitting of food is taken, and after that, nothing is eaten or drunk (except boiled water, if allowed as per your sect/tradition).
Regarding your specific question: If you had water at 3 am in the morning (before sunrise), it does not generally break the ekashana vow, because the period of ekashana is usually counted from sunrise to sunset. Activities before sunrise, such as drinking water, do not affect the one-meal rule unless your particular tradition has stricter rules (always check with your guru or Jain elders for your sect's guidelines).
However, once the sun rises and you have taken your meal (ekashana), you should not eat or drink (except for boiled water, if permitted, and only during daylight hours) again that day.
Summary: Yes, you can do ekashana even if you had water at 3 am, as ekashana focuses on the period from sunrise onwards. Be sure to observe the rules related to your specific Jain sect and consult with your spiritual guide for precise observance.