[jboss-user] [JBoss Seam] - How to map DSN name with actual database ? Please help.

laxmantr do-not-reply at jboss.com
Mon Jul 24 13:03:39 EDT 2006


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 at 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#3960468

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3960468



More information about the jboss-user mailing list