[Hibernate][error] Could not execute JDBC batch update
Bonjour à tous,
lors de l'execution d'une réquete j'ai l'erreur suivante :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| exception
javax.servlet.ServletException: Could not execute JDBC batch update
org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:535)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:433)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
cause mère
org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:249)
org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:235)
org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139)
org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:297)
org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
be.qspin.qats.business.HibernateUtility.setRow(HibernateUtility.java:99)
be.qspin.qats.business.Applicants.createApplicant(Applicants.java:53)
be.qspin.qats.struts.action.CreateApplicantAction.execute(CreateApplicantAction.java:84)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368) |
le .hbm:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
| <hibernate-mapping default-lazy="false">
<class name="be.qspin.qats.entities.Applicant" table="APPLICANTS">
<meta attribute="class-description">
Define an "Applicant" entity.
</meta>
<id name="id" type="integer" column="ID">
<generator class="increment">
</generator>
</id>
<property name="lastname" type="string" not-null="true">
<column name="LASTNAME" length="20" not-null="true"/>
</property>
<property name="firstname" type="string" not-null="true">
<column name="FIRSTNANE" length="20" not-null="true"/>
</property>
<property name="gender" type="string" not-null="true">
<column name="GENDER" length="20" not-null="true"/>
</property>
<property name="birthday" type="timestamp" not-null="true">
<column name="BIRTHDAY" length="20" not-null="true"/>
</property>
<property name="nationality" type="string" not-null="true">
<column name="NATIONALITY" length="20" not-null="true"/>
</property>
<property name="address" type="string" not-null="true">
<column name="ADDRESS" length="20" not-null="true"/>
</property>
<property name="PC" type="string" not-null="true">
<column name="PC" length="20" not-null="true"/>
</property>
<property name="city" type="string" not-null="true">
<column name="CITY" length="20" not-null="true"/>
</property>
<property name="country" type="string" not-null="true">
<column name="COUNTRY" length="20" not-null="true"/>
</property>
<property name="phone" type="string" not-null="true">
<column name="PHONE" length="20" not-null="true"/>
</property>
<property name="gsm" type="string" not-null="true">
<column name="GSM" length="20" not-null="true"/>
</property>
<property name="email" type="string" not-null="true">
<column name="EMAIL" length="20" not-null="true"/>
</property>
<property name="interest" type="string" not-null="true">
<column name="INTEREST" length="1" not-null="true"/>
</property>
<many-to-one name="jobTitle" column="TITLE" class="be.qspin.qats.entities.JobTitle" cascade="none" not-null="true"/>
</class>
</hibernate-mapping> |
le .java :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
public static Applicant createApplicant(String lastname, String firstname, String selectJobTitle, String jobTitle, String interest, String gender, Date birthday, String nationality, String address, String PC, String city, String country, String phone, String gsm, String mail){
Applicant appl = new Applicant();
JobTitle jT = new JobTitle();
jT.setTitle(jobTitle);
appl.setLastname(lastname);
appl.setFirstname(firstname);
appl.setGender(gender);
appl.setBirthday(birthday);
appl.setNationality(nationality);
appl.setAddress(address);
appl.setPC(PC);
appl.setCity(city);
appl.setCountry(country);
appl.setPhone(phone);
appl.setGsm(gsm);
appl.setEmail(mail);
appl.setInterest(interest);
System.out.println(appl.toString());
if (selectJobTitle.equals("new"))
HibernateUtility.setRow(jT);
jT = (JobTitle) HibernateUtility.getRow(JobTitle.class, "title", jT.getTitle());
appl.setJobTitle(jT);
HibernateUtility.setRow(appl);
return appl;
} |
et l'insertion Hibernate :
Code:
1 2 3 4 5 6 7
| public static void setRow(Object obj) {
Session session = getHibernateSession();
Transaction tx = session.beginTransaction();
session.saveOrUpdate(obj);
tx.commit();
session.close();
} |
pouvez vous m'aider et me dire d'ou vient l'erreur
merci