Just want to add something. I did this example and it work for me until now. It’s just initially I get confused with database. So people please create database hibernatetutorial. That is in mysql and if there is password there then open then mentioned that in your hibernate.hbm.xml file. After doing so it will give exactly same result as shown above. Hope it helps