When 120-volt electric current (alternating current) leaks from nearby boats or docks, it's called Electric Shock Drowning (ESD). EDS has electrocuted or incapacitated many swimmers in the water. Too many people have died from ESD, and sadly many were children having fun swimming near someone's private dock.
SHOUT and SCREAM. Tell people what is happening so they can shut off the power and warn others to stay out of the water. Do not swim toward the dock! Instead move farther away - try to reach shore at least 100 metres away from the danger.
Never get in the water yourself - you could be electrocuted yourself! To retrieve a person in the water, reach out with an oar or throw a line they can grab. Or you can row (only) to them. If your boat does not have a boarding ladder, you could take a line fastened to the boat and tie a loop (Bowline is best) in the end large enough to pass over their shoulders and under their arms. Tow them away from the danger if you can't get them on board quickly. If the person is yelling, they are not drowning.
Test your boat once a year to see if it is leaking electricity by hiring an electrician or buying a clamp meter to test it yourself. If you find any problems, have your boat inspected by a qualified electrician trained to American Boat and Yacht Council (ABYC) standards.
Have an electrician (ABYC trained) install an Equipment Leakage Circuit Interrupter (ELCI) or an isolation transformer on your boat. Instead, you may use a Ground Fault Circuit Interrupter (GFCI) between shore power plug and your power cord.
Marine wiring and installation requires higher standards than houses due to the environment of water and motion. If you keep your boat in a marina, check to make sure there is a GFCI on all dock receptacles - it should be easily accessible.
Never work on your boat from the water when it is plugged in to shore power. In particular never touch underwater fittings when your boat is plugged in.
Never swim within 100 metres of a dock using electrical power - it's just too dangerous!
Information from the Electric Shock Drowning Resource Center http://www.BoatUS.com/seaworthy/ESD.asp