I am only a student of Islamic history. To the best of my knowledge the following three verses describe what the holy Quran says about wine and drinking.
002.219
They ask thee concerning wine and gambling. Say: "In them is great sin, and some profit, for men; but the sin is greater than the profit." They ask thee how much they are to spend; Say: "What is beyond your needs." Thus doth Allah Make clear to you His Signs: In order that ye may consider-
004.043
O ye who believe! Approach not prayers with a mind befogged, until ye can understand all that ye say,- nor in a state of ceremonial impurity (Except when travelling on the road), until after washing your whole body. If ye are ill, or on a journey, or one of you cometh from offices of nature, or ye have been in contact with women, and ye find no water, then take for yourselves clean sand or earth, and rub therewith your faces and hands. For Allah doth blot out sins and forgive again and again.
005.090
O ye who believe! Intoxicants and gambling, (dedication of) stones, and (divination by) arrows, are an abomination,- of Satan's handwork: eschew such (abomination), that ye may prosper
I dont see clear cut order banning the wine altogether even though drinking has been described as great sin. Some of the holy Prophets (PBUH) companions must be heavy drinkers during the early period of Islamic state in Medina otherwise a Qurans verse asking the faithful not to enter the mosque wouldn't be revealed.
According to Sahih Bukhari
The selling of alcoholic drinks were made unlawful in the year of the conquest of Mecca...Sahih Bukhari: 5.59.590
This is the history. What does Sharia and Hadith say about it? I cant say with any certainty.
Regardless of whether prohibited or not, wine drinking has been quite prevalent among the poets and the aristocracy ever since the Omayyad period.