“David consoled his wife Batsheva; he went to her and lay with her. She bore a son and she named him Shlomo. Hashem favored him” II SAMUEL 12:24 (The Israel Bible™)
King David repents for what he did, and he and Batsheva are blessed with a son. The son is known as Solomon, or in Hebrew, Shlomo (שלמה),which comes from the word shalom (שלום), ‘peace.’ Additionally, he is also called by the name Jedidiah, in Hebrew, Yedidya (ידידיה), meaning ‘beloved of God.’ Radak suggests that Hashem wants his name to be Shlomo, as he would be the next king of Israel, and during his rule God would bless him and the People of Israel with peace. But Shlomo is also called Yedidya, as he is truly the beloved of God. During his reign, the Nation of Israel achieves the greatest heights of peace in the Land of Israel, peace among the People of Israel, and service to Hashem in the Beit Hamikdash.