It seems the guy who wrote this never tested it actually.
Without the Transaction tx = session.beginTransaction() and tx.commit(), you will never get a row inserted into the db. If you give that, everything works fine....
To yolan,
U have to create a database like this. create database hibernatetutorial; use hibernatetutorial; then create the table. then execute the program. It will work...