Xu Yuyuan, 47, an unemployed local man, was found guilty of attacking a kindergarten in Taixing city in eastern Jiangsu province last month.
A string of attacks at Chinese schools has killed a total of 27 people and injured more than 80 since March, prompting calls for better protection of students and worries about the social malaise that some see underneath China's rapid economic growth.
Xu told the court that his motive was to "vent his rage against society", the official Xinhua news agency reported.
Premier Wen Jiabao said this week the outburst of violence had deep-seated roots in the country's social tensions that need addressing. Officials have vowed to "strike hard" against the problem.