Passing 9v to Buzzer when Arduino PWM Pin is high..

Hello

I want to build a simple project with a LOUD buzzer...The buzzer activates if the temp is high .. Thats it..
the Project will operate with a 9v battery, i finish it but the buzzer is not very loud...
I connect the buzzers + to pin 5.. , I want to pass more voltage... the buzzer is rated for 9v , so i want to use my operating battery 9v and pass 9v to the buzzer when the pin5 is activated..

will this circuit work?

or maybe this circuit?
using a PN2222

arduino-buzzer-circuit-connections (1).png

Yes both circuits are essentially the same and would work.