12 Wisdom and knowledge is granted unto thee; and I will give thee riches, and wealth, and honour, such as none of the kings have had that have been before thee, neither shall there any after thee have the like.

Solomon a type of Messiah

How was this knowledge imparted? Not by study but by direct divine impression - ''Wisdom and knowledge is granted unto thee''. He knew to choose the right (wisdom) as each test of faith presented itself.

And the spirit of Yahweh shall rest upon him, the spirit of wisdom and understanding, the spirit of counsel and might, the spirit of knowledge and of the fear of Yahweh; Isa 11: 2.