I am trying to connect to database using hibernate in a seam project. I have put the
following code in hibernate.cfg.xml
com.mysql.jdbc.Driver
jdbc:mysql://localhost/testdb
root
10
true
org.hibernate.dialect.MySQLDialect
update
<!-- Mapping files -->
I have a test program which uses the DSN to insert a record. Code goes like this:
SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
session =sessionFactory.openSession();
Contact contact = new Contact();
contact.setId(3);
contact.setFirstName("Deepak");
contact.setLastName("Kumar");
contact.setEmail("deepak_38(a)yahoo.com");
session.save(contact);
when I run this program , database gets connected but it throws a strange exception (
ehCache exception ) in the first line of test program.
I tried various possible options. But no luck. I have been trying this from past 1 week.
Please help me. Please let me know if anyone needs more information.
regards,
Laxman
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3960468#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...