(1) If there is any need for the construction of a dam, the owner of a water course may attach it to the opposite bank; provided, he must pay compensation for any damage caused thereby.
(2) If a part of a water course belongs to the owner of the opposite bank, he may use the dam; but he must bear the expenses of the construction and preservation of the dam in proportion to the benefit he derives therefrom.