The incident was one of a spate of attacks on Chinese schools since March that have killed a total of 27 people and injured more than 80.
In two cases the attackers committed suicide.
|The Taixing attack left 28 children injured, some of them seriously [Reuters]
One man, a former doctor who stabbed eight children to death at a school in southeastern China on March 23, has already been executed.
The series of attacks have prompted calls for better security at schools and highlighted worries about the social impact underlying China's rapid economic growth.
Studies have cited a rise in mental illnesses, some linked to stress, as society becomes more fast-paced and old social safety nets have been scrapped.
Reporting on Xu's execution China's state-run Xinhua news agency said he had "admitted his motive was to vent rage against society after losing money in gambling and business, while suffering other setbacks in his personal life."
According to a previous Xinhua report, the court decided that even though Xu had not succeeded in killing his victims, "his criminal motivation was extremely despicable, his means extremely cruel, his plot especially evil."