David was God’s anointed king and had the Holy Spirit but God did not speak to him directly. He spoke to him through prophets such as Samuel, Gad and Nathan. For example:
1 Samuel 22:5 And the prophet Gad said unto David, Abide not in the hold; depart, and get thee into the land of Judah. Then David departed, and came into the forest of Hareth. 2 Samuel 7:2 That the king said unto Nathan the prophet, See now, I dwell in an house of cedar, but the ark of God dwelleth within curtains.
2 Samuel 7:4 And it came to pass that night, that the word of the LORD came unto Nathan, saying, 5 Go and tell my servant David, Thus saith the LORD, Shalt thou build me an house for me to dwell in?
2 Samuel 12:25 And he sent by the hand of Nathan the prophet; and he called his name Jedidiah, because of the LORD.
He was also able to enquire of God via the Priest with the ephod (we must assume that the ephod had the breastplate attached with the Urim and thummim to give the answers).
1 Samuel 23:9 And David knew that Saul secretly practised mischief against him; and he said to Abiathar the priest, Bring hither the ephod. 10 Then said David, O LORD God of Israel, thy servant hath certainly heard that Saul seeketh to come to Keilah, to destroy the city for my sake. 11 Will the men of Keilah deliver me up into his hand? will Saul come down, as thy servant hath heard? O LORD God of Israel, I beseech thee, tell thy servant. And the LORD said, He will come down. 12 Then said David, Will the men of Keilah deliver me and my men into the hand of Saul? And the LORD said, They will deliver thee up.
David, even as king of Israel, did not have a personal relationship with God by direct communication. Communication with God through prophets is not possible today for there are no prophets. The Bible shows that the last and greatest prophet is Jesus Christ, the son of God.
Hebrews 1:1 God, who at various times and in various ways spoke in time past to the fathers by the prophets, 2 has in these last days spoken to us by His Son, whom He has appointed heir of all things, through whom also He made the worlds; Jesus’ final prophecy was given to John c AD96 and is the last book in the New Testament. The opening verse reads:
Revelation 1:1 The Revelation of Jesus Christ, which God gave unto him, to shew unto his servants things which must shortly come to pass; and he sent and signified it by his angel unto his servant John:
ome of the final verses read:
Revelation 22:18 For I testify unto every man that heareth the words of the prophecy of this book, If any man shall add unto these things, God shall add unto him the plagues that are written in this book: 19 And if any man shall take away from the words of the book of this prophecy, God shall take away his part out of the book of life, and out of the holy city, and from the things which are written in this book.
It may be argued that the prohibition on adding to or taking from applies only to this book but in my opinion the principle applies to all the canon of scriptures completed by the end of the 1st century. There have been no prophets since, neither is there a need because God’s revelation of his plan and purpose is completed in Jesus Christ and all that is necessary for us to know is preserved in written form.
2 Timothy 3:16 All scripture is given by inspiration of God, and is profitable for doctrine, for reproof, for correction, for instruction in righteousness: 17 That the man of God may be perfect, throughly furnished unto all good works.
The doctrine is complete.
1 Timothy 4:16 Take heed unto thyself, and unto the doctrine; continue in them: for in doing this thou shalt both save thyself, and them that hear thee.
2 John 1:10 If there come any unto you, and bring not this doctrine, receive him not into your house, neither bid him God speed:
The gospel is complete.
Galatians 1:8 But though we, or an angel from heaven, preach any other gospel unto you than that which we have preached unto you, let him be accursed. 9 As we said before, so say I now again, If any man preach any other gospel unto you than that ye have received, let him be accursed.
All professed prophets that have arisen since the end of the 1st century have been false prophets.
Matthew 24:11 And many false prophets shall rise, and shall deceive many.
No further prophets are required because the scriptures themselves are able to make us ‘wise unto salvation’ through faith in Christ.
2Timothy 3:15 And that from a child thou hast known the holy scriptures, which are able to make thee wise unto salvation through faith which is in Christ Jesus.
What is required of us is that we understand and obey the gospel preached by Christ.
Mark 16:15 And he said unto them, Go ye into all the world, and preach the gospel to every creature. 16 He that believeth and is baptized shall be saved; but he that believeth not shall be damned (condemned).
God has determined that salvation should be made available through the ‘foolishness’ of the preaching of the gospel rather than direct individual communication.
1 Corinthians 1:21 For after that in the wisdom of God the world by wisdom knew not God, it pleased God by the foolishness of preaching to save them that believe.
Romans 1:16 For I am not ashamed of the gospel of Christ: for it is the power of God unto salvation to every one that believeth; to the Jew first, and also to the Greek.
1 Corinthians 15:1 Moreover, brethren, I declare unto you the gospel which I preached unto you, which also ye have received, and wherein ye stand;
Colossians 1:23 If ye continue in the faith grounded and settled, and be not moved away from the hope of the gospel, which ye have heard, and which was preached to every creature which is under heaven; whereof I Paul am made a minister;
When we read the scripture God speaks to us through the written word. When we pray, God hears our prayers. There is no personal relationship with God that involves him speaking to us in visions and dreams in the way that he spoke to the prophets. David is really an example to us of a man who did not have a personal relationship with God by direct communication. His understanding came through reading and meditating on the word of God and believing the words of the prophets sent to him.
Psalm 19:7 The law of the LORD is perfect, converting the soul: the testimony of the LORD is sure, making wise the simple. 8 The statutes of the LORD are right, rejoicing the heart: the commandment of the LORD is pure, enlightening the eyes. 9 The fear of the LORD is clean, enduring for ever: the judgments of the LORD are true and righteous altogether. 10 More to be desired are they than gold, yea, than much fine gold: sweeter also than honey and the honeycomb. 11 Moreover by them is thy servant warned: and in keeping of them there is great reward. 12 Who can understand his errors? cleanse thou me from secret faults. 13 Keep back thy servant also from presumptuous sins; let them not have dominion over me: then shall I be upright, and I shall be innocent from the great transgression. 14 Let the words of my mouth, and the meditation of my heart, be acceptable in thy sight, O LORD, my strength, and my redeemer.
I hope you have found this helpful.