During our Yamim Tovim there is a Mitzva to Davka drink wine, like it says: וְשָּמַחְתָּ בְחַגֶךָ you shall rejoice on Yom Tov, and: ל ֹ א נִ יתְ נוּ יָּ מיִ ם טוֹבִ ים אֶ לָּ א לַ עֲ סוֹק בְ תוֹרָּ ה ירושלמי שבת פט"ו ה"ג the main point of the Yom Tov is to have an opportunity to learn Torah. We have Torah with wine; this is our Sukkos diet, and Torah itself is called wine. (Gemara). Like when you make a Siyum, you drink L’chaim in happiness over the Torah that you learned. Being happy over the Torah you learned is also a form of learning Torah.
And Dovid wanted that his Tehilim should be considered like Nega'im and Ohalos. When the Rambam says that Torah helps you conquer Arayos, he brings the Passuk: בְאַהֲבָּתָּהּ תִשְ גֶה תָּמִיד משלי ה יט “be constantly involved in the love of Torah”, and תִשְ גֶה means: שִ גָּ יוֹן Meshuga. Sometimes the very Gemara can make you happy and almost Meshuga with Simcha. I heard from a Talmid of Slabodka that they had a student there who was described as Shikor (drunk) from Torah, and he became a famous Gadol B’yisroel.