Do you dread the moment when a friendly stranger approaches you and your dog and asks, "Can I pet your dog?"
As Fluffy, your exuberant Golden Retriever, becomes an airborne missile, you attempt to warn the unsuspecting young man to get back. But it's too late. Fluffy has left dirty paw prints on the guy's khakis, and he doesn't seem to want any more interactions with your pup. Fluffy is not the problem - YOU are. It is your responsibility to train Fluffy.
Is it possible to teach an energetic dog to sit politely for petting? Yes. Is it convenient to do so? Definitely not. If you can stay calm, and stick with it, replacing a socially acceptable behavior is a realistic goal.
Most of the time, jumping up begins as a cute behavior that very young pups do to solicit attention. It's only cute for a short while, especially in the case of a large breed puppy. The jumping usually escalates until it evokes an angry response from the owner. Losing patience is not a constructive approach. In fact, any extra emotion or excitement is counter-productive with jumping.
Even a small dog can be a nuisance if it jumps and lunges toward people. A medium or large dog can be an absolute hazard. Once a 50 or 60 lb. pup launches itself at a person, the old standby command of "OFF!" is too little, too late. Prevent the jumping, don't react after the fact.
In class, teaching a Sit begins the process. Lure the dog into position, using a treat above the dog's nose, moving your hand back toward the dog's rear. In training, Sit will be the "default" behavior, which will be rewarded with goodies and praise. The food rewards can be faded gradually later, as the new pattern replaces the old one.
Moving to the next step, encourage the pup to Stay in the Sit position by withholding the treat for just a brief second, then lengthen the time he's sitting very gradually. If he gets up from the Stay, interrupt with an "Uh oh", and lure him back into Sit position. There's no need for harsh corrections. If necessary, have a leash on Fluffy.
The next phase is teaching Settle, first to establish leadership. By saying, "Settle," then examining him as you hold him ion a loose but calm position, he's learning that you are deciding when he is released. After a brief moment, release Fluffy with a word or words of your choice (such as Okay, All Done, Free, etc.).
The following week, Settle is added to the sequence of Sit, Stay, to help Fluffy understand that he needs to wait politely to be petted. If he should jump up on the person who is petting him, that person turns and walks away. You place Fluffy back in Sit/Stay, and he gets to try again. If you are patient, and reward Fluffy for each tiny improvement in controlling his excitement, he will learn the right way to meet and greet. The difference is - he will be reminded to Settle before he jumps, instead of being told Off after he jumps. It is always better to be proactive than reactive.