Joined: Wed Jul 26, 2006 1:41 pm Posts: 18
|
I am trying to insert data in to DB.But i get the following exception on my tomcat
" org.hibernate.exception.GenericJDBCException: could not insert : [org.theclass.candidate.view.Candidate]"
I looked exhaustively in the forum,but could not find any help
Hibernate version:
3.1
Mapping documents:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="org.theclass.candidate.view.Candidate" table="candidate">
<id name="candidateid" column="candidateid" type="java.lang.Integer">
<generator class="native"/>
</id>
<property name="firstname" column="firstname" length="30" type="java.lang.String"/>
<property name="middlename" column="middlename" length="30" type="java.lang.String"/>
<property name="lastname" column="lastname" length="30" type="java.lang.String"/>
<property name="addrsline1" column="addrsLine1" length="30" type="java.lang.String"/>
<property name="addrsline2" column="addrsLine2" length="30" type="java.lang.String"/>
<property name="city" column="city" length="30" type="java.lang.String"/>
<property name="state" column="state" length="2" type="java.lang.String"/>
<property name="zipcode" column="zipcode" length="30" type="java.lang.Integer"/>
<property name="homephno" column="homePhNo" length="30" type="java.lang.String"/>
<property name="cellphno" column="cellPhNo" length="30" type="java.lang.String"/>
<property name="email" column="email" length="30" type="java.lang.String"/>
<property name="skills" column="skills" length="30" type="java.lang.String"/>
<property name="status" column="status" length="30" type="java.lang.String"/>
<property name="teaminterest" column="teamInterest" length="30" type="java.lang.String"/>
<property name="jobpositions" column="jobPositions" length="30" type="java.lang.String"/>
<property name="experience" column="experience" length="30" type="java.lang.String"/>
</class>
</hibernate-mapping>
Config file:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<!-- Database connection settings -->
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/theclass_TheClassDB?autoReconnect=true</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">***</property>
<!-- SQL dialect -->
<!--<property name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</property> -->
<!-- <property name="dialect">org.hibernate.dialect.MySQLInnoDBDialect</property> -->
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<!-- Enable Hibernate's automatic session context management -->
<property name="current_session_context_class">thread</property>
<!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size">1</property>
<!-- Drop and re-create the database schema on startup -->
<property name="hbm2ddl.auto">update</property>
<!-- Disable the second-level cache-->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>
<property name="transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
<mapping resource="org/theclass/candidate/view/Candidate.hbm.xml"/>
</session-factory>
</hibernate-configuration>
Name and version of the database you are using:
Mysql 4.1
Can some one help me ?
|
|