-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: org.hibernate.exception.GenericJDBCException: please help
PostPosted: Fri Dec 15, 2006 3:48 pm 
Newbie

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 ?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 15, 2006 5:24 pm 
Expert
Expert

Joined: Wed Apr 06, 2005 5:03 pm
Posts: 273
Location: Salt Lake City, Utah, USA
You need to post the full stack trace of the exception before anyone can help.

_________________
nathan


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 15, 2006 7:01 pm 
Newbie

Joined: Wed Jul 26, 2006 1:41 pm
Posts: 18
Now i am not getting that exception. I dont understand why. i did nothing.
In Tomcat i got only this message
org.hibernate.exception.GenericJDBCException: could not insert : [org.theclass.candidate.view.Candidate]


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.