He's still young, and this is his first class I'm assuming?
How is he while training just outside on the sidewalk, in a park, etc? I would work really hard in medium distraction areas at keeping his attention.
In both puppy and basic obedience classes I would always bring a tug toy, treats and a blanket. First, he was taught from day one to stay on the blanket while I was seated, the only time he was allowed off the blanket was when we were actively working. Second, all play and sniffing was only done offleash so he knew onleash time was work only. Third, most classes can be boring for dogs, when the trainer speaks all the humans are listening and nothing is going on for the dogs. So that's when I would pull out the tug toy, I could play tug quietly with Delgado if I saw him getting bored and it was a quiet way of entertaining him while I could still listen intently to what the trainer was saying.
Stick with it, even if you need to back farther away from the class to keep his attention, the benefits of him learning to listen to you while in such a high distraction area is invaluable.
Jasmine - Female Miniature Poodle - born Aug 15, 2010
Loker Delgado Von Stalworth - Male GSD - born Jan 26, 2012
Koda & Zazu - 5 year old male cats
Alex - Male Cocker Spaniel (rescue) - RIP Cuddlebug 2007-2010