I Chronicles 28:7 Midrash

וַהֲכִינוֹתִ֥י אֶת־מַלְכוּת֖וֹ עַד־לְעוֹלָ֑ם אִם־יֶחֱזַ֗ק לַעֲשׂ֛וֹת מִצְוֺתַ֥י וּמִשְׁפָּטַ֖י כַּיּ֥וֹם הַזֶּֽה׃

And I will establish his kingdom for ever, if he be constant to do My commandments and Mine ordinances, as at this day.

Read midrashic interpretation of I Chronicles 28:7: and classical rabbinic exegesis.