facebook

MyEclipse Hibernate and Spring Tutoriial unable to save User

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #299883 Reply

    AnupChauhan
    Member

    I was trying this MyEclipse Hibernate and Spring Tutorial from MyEclipse Education Material hosted on this site.
    I am trying this but not getting to save new user..I changed the Integer and also
    created primary key autogeneration from table .But All my attempts do not work.
    I am following the Steps exactly as per tutorial.I have tried with 7.1 and 7.5.
    Please help…Is there a configuration to be done not mentioned in the tutorial.

    I am just Copy pasting the tutorial code not working as it should below

    nteger id = new Integer(1);
    User user = new User();
    user.setId(id);
    user.setUsername(“jdoe”);
    user.setPassword(“1234”);
    user.setFirstName(“John”);
    user.setLastName(“Doe”);
    user.setDateCreated(Long.valueOf(System.currentTimeMillis()));

    /* 2. Load the Spring bean configuration and create a bean factory */
    BeanFactory beanFactory = new XmlBeanFactory(new ClassPathResource(
    “applicationContext.xml”));

    /* 3. Create instance of PersistenceLayer */
    PersistenceLayer persistenceLayer = (PersistenceLayer) beanFactory
    .getBean(“persistenceLayer”);

    /* 4. Save the new user to the database */
    persistenceLayer.addUser(user);
    ____DOES NOT SAVE THE USER NOR IT DOES GIVE ANY ERROR________
    please help ,
    Anup Chauhan

    #299895 Reply

    Loyal Water
    Member
Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: MyEclipse Hibernate and Spring Tutoriial unable to save User

You must be logged in to post in the forum log in