I'm with brettski,I've replaced more rotted posts then I care to talk about.

From now on we use concrete footings with a stainless bolt embedded in them that attaches a u shaped bracket to attach the posts.

It sounds hard but a simple round form and some wire reinforcements used for drive ways will do the trick for all but the big stuff.

For underwater you have options too,on small docks you can prefab them above water,jet a hole with a hose and then back fill with gravel.