update 3 ways connections and add 2 ways insert in table