The Gemara in Sotah 48b writes:
משמתו נביאים הראשונים מאן נביאים הראשונים אמר רב הונא זה דוד ושמואל ושלמה
§ The mishna taught: From the time when the early prophets died, the Urim VeTummim was nullified. The Gemara poses a question: Who are the early prophets? Rav Huna says: This is referring to David, and Samuel, and Solomon, and after their death the Urim VeTummim was no longer used. (Sefaria translation & notation)