You could use some shielded couplings like these.
I have an installation as in the photo attached. This is a deep tub which will sit on a mortar bed on concrete. The drain/overflow is rigid and the ptrap is in concrete. On a dry-run I am left with about 3 1/2Ē from the bottom of the sanitary T to the exposed 1 1/2 drain. The latter is fixed in the concrete floor. What Iím looking for is a way to join these (that can be removed if necessary) that has some flexibility if the two parts arenít exactly the right distance apart after final assembly. A threaded part relies on being tightly together for an air-tight fit and therefore less flexible.