Hibernate Mapping file is :
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.url">
jdbc racle:thin:@localhost:1521:xe</property>
<property name="hibernate.connection.username">SAURABH-PRACTICE</property>
<property name="hibernate.connection.password">sys123</property>
<property name="hibernate.connection.pool_size">10</property>
<property name="show_sql">true</property>
<property name="dialect">org.hibernate.dialect.OracleDialect</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<!-- Mapping files -->
<mapping resource="contact.hbm.xml"/>
I was trying to insert a simple data inside a table (Contact).
try {
SessionFactory sessionFactory = new Configuration().configure()
.buildSessionFactory();
session = sessionFactory.openSession();
System.out.println("Inserting Record");
Contact contact = new Contact();
contact.setId(6);
contact.setFirstName("Alice");
contact.setLastName("Wonderland");
contact.setEmail("Alice.Wonderland@yahoo.com");
session.save(contact);
System.out.println("Done");
} catch (Exception e) {
System.out.println(e.getMessage());
e.printStackTrace();
} finally {
session.flush();
session.close();
}
<<<<< Problem: It is going smoothly, but it is not inserting any data in the table and also not throwing any exception for the same. >>>>>>
Is there any problem with the OracleDialect?
should i use something else?