title: how to insert values in database using Hibernate in dynamic web project
body: <p><strong>User_manager.java</strong></p>
  
  <pre><code>package com.csc.trg.twit_clone.tweet_pack;
  
  import org.hibernate.SessionFactory;
  import org.hibernate.Transaction;
  import org.hibernate.cfg.Configuration;
  import org.hibernate.classic.Session;
  
  public class User_Manager 
  {
  
      public static void main(String[] args)
  
      {  
            //creating configuration object  
          Configuration cfg=new Configuration();  
          cfg.configure("hibernate.cfg.xml");//populates the data of the configuration file         
          //creating session factory object     
          SessionFactory factory=cfg.buildSessionFactory();         
          //creating session object  
          Session session=factory.openSession();    
          //creating transaction object  
          Transaction t=session.beginTransaction();  
          User_Bean H =new User_Bean();
        H.setUserId(1001);  
          H.setUserName("visgf");  
          H.setUserPwd("passw");
         H.setEmailId("visa@gmail.com");
         // session.persist(H);                   //persisting the object  
            session.save(H);
  
          t.commit();                         //transaction is committed  
          session.close(); 
          factory.close();
  
          System.out.println("successfully registered");  
          }
  }
  
  **user_bean**
  
  package com.csc.trg.twit_clone.tweet_pack;
  public class User_Bean
  {
  
      int userId;
      String userName;
      String emailId;
      String userPwd;
  
  public String getUserPwd() 
  {
      return userPwd;
  }
  public void setUserPwd(String userPwd) 
  {
      this.userPwd = userPwd;
  }
  
  public int getUserId() 
  {
      return userId;
  }
  public void setUserId(int userId)
  {
      this.userId = userId;
  }
  public String getUserName()
  {
      return userName;
  }
  public void setUserName(String userName) 
  {
      this.userName = userName;
  }
  public String getEmailId() 
  {
      return emailId;
  }
  public void setEmailId(String emailId)
  {
      this.emailId = emailId;
  }
  
  }
  
  **hibernate.cfg.xml**
  
  &lt;?xml version='1.0' encoding='UTF-8'?&gt;  
  &lt;!DOCTYPE hibernate-configuration PUBLIC  
            "-//Hibernate/Hibernate Configuration DTD 3.0//EN"  
            "hibernate-configuration-3.0.dtd"&gt;  
  
  &lt;hibernate-configuration&gt;  
  
      &lt;session-factory&gt;  
      &lt;property name="connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt; 
          &lt;property name="connection.url"&gt;jdbc:mysql://localhost/payrol&lt;/property&gt;  
          &lt;property name="connection.username"&gt;root&lt;/property&gt;   
          &lt;property name="connection.password"&gt;root&lt;/property&gt;  
           &lt;property name="show_url"&gt;true&lt;/property&gt; 
          &lt;property name="dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt;        
           &lt;property name="hbm2ddl.auto"&gt;update&lt;/property&gt;  
      &lt;mapping resource="twitt.hbm.xml"/&gt;  
      &lt;/session-factory&gt;  
  &lt;/hibernate-configuration&gt;  
  
  **twit.hbm.xml**
  
  &lt;?xml version='1.0' encoding='UTF-8'?&gt;  
  &lt;!DOCTYPE hibernate-mapping PUBLIC  
   "-//Hibernate/Hibernate Mapping DTD 3.0//EN"  
   "hibernate-mapping-3.0.dtd"&gt;  
  
   &lt;hibernate-mapping&gt;  
  
    &lt;class name="com.csc.trg.twit_clone.tweet_pack.User_Bean" table="User_table"&gt;  
      &lt;id name="userId"&gt;  
       &lt;generator class="assigned"/&gt;  
      &lt;/id&gt;  
      &lt;property name="userId" column="user_name" type="int" /&gt;
      &lt;property name="userName" column="user_name" type="string" /&gt;  
         &lt;property name="password" column="password" type="string" /&gt; 
         &lt;property name="emailId" column="email" type="String" /&gt;
    &lt;/class&gt;            
   &lt;/hibernate-mapping&gt;  
  </code></pre>
  
  <p>I'm trying to update the values to mysql database from java program using hibernate this is my first program in hibernate " I m getting this error plz help.</p>
  
  <pre><code>log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
  log4j:WARN Please initialize the log4j system properly.
  Exception in thread "main" org.hibernate.MappingException: Could not determine type for: String, for columns: [org.hibernate.mapping.Column(email)]
      at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:266)
      at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:253)
      at org.hibernate.mapping.Property.isValid(Property.java:185)
      at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:410)
      at org.hibernate.mapping.RootClass.validate(RootClass.java:192)
      at org.hibernate.cfg.Configuration.validate(Configuration.java:1099)
      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1284)
      at com.csc.trg.twit_clone.tweet_pack.User_Manager.main(User_Manager.java:21)
  </code></pre>
  
  <p>I have added both the tdd, configuration and mapping files in src. And added all the jars.</p>