Fixed SQL to add technical ID. #264.
Fixed Java code to support technical ID. #264.