jophis wrote:
This is my code:
Example.java
SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
session =sessionFactory.openSession();
//Create new instance of Contact and set values in it by reading them from form object
System.out.println("Inserting Record");
Contact contact = new Contact();
contact.setId(123);
contact.setFirstName("shah");
contact.setLastName("shah");
contact.setEmail("deepak_38@yahoo.com");
session.save(contact);
You are missing the session.getTransaction().commit() here.
It was probably working under MySQL 4.0 because you were using MyISAM tables, which do not support transactions.