A simple java program involved database, multi-thread, synchronize, socket. A reference for my future programming