-->
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: ERROR [main] (JDBCExceptionReporter.java:46) - A syntax erro
PostPosted: Mon May 24, 2004 2:32 am 
Beginner
Beginner

Joined: Thu Apr 29, 2004 4:03 pm
Posts: 40
Hi guys, any ideas what could be the problem?

ERROR [main] (JDBCExceptionReporter.java:46) - A syntax error has occurred.
ERROR [main] (JDBCExceptionReporter.java:46) - A syntax error has occurred.
ERROR [main] (JDBCException.java:38) - could not insert: [cz.aura.isl.katalog.davky.domain.ZpravaKatalogu]
java.sql.SQLException: A syntax error has occurred.
at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:355)
at com.informix.jdbc.IfxSqli.addException(IfxSqli.java:3086)
at com.informix.jdbc.IfxSqli.receiveError(IfxSqli.java:3396)
at com.informix.jdbc.IfxSqli.dispatchMsg(IfxSqli.java:2259)
at com.informix.jdbc.IfxSqli.receiveMessage(IfxSqli.java:2179)
at com.informix.jdbc.IfxSqli.executePrepare(IfxSqli.java:1082)
at com.informix.jdbc.IfxResultSet.executePrepare(IfxResultSet.java:182)
at com.informix.jdbc.IfxPreparedStatement.setupExecutePrepare(IfxPreparedStatement.java:197)
at com.informix.jdbc.IfxPreparedStatement.<init>(IfxPreparedStatement.java:175)
at com.informix.jdbc.IfxSqliConnect.prepareStatement(IfxSqliConnect.java:1907)
at org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:216)
at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.prepareStatement(PoolingDataSource.java:323)
at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:249)
at net.sf.hibernate.impl.BatcherImpl.prepareStatement(BatcherImpl.java:61)
at net.sf.hibernate.impl.BatcherImpl.prepareStatement(BatcherImpl.java:56)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:540)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:432)
at net.sf.hibernate.impl.ScheduledIdentityInsertion.execute(ScheduledIdentityInsertion.java:29)
at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:925)
at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:850)
at net.sf.hibernate.impl.SessionImpl.saveWithGeneratedIdentifier(SessionImpl.java:768)
at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:731)
at org.springframework.orm.hibernate.HibernateTemplate$8.doInHibernate(HibernateTemplate.java:242)
at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:150)
at org.springframework.orm.hibernate.HibernateTemplate.save(HibernateTemplate.java:240)
at cz.aura.isl.katalog.dao.hibernate.HibernateZpravaKataloguDAO.insertZpravu(HibernateZpravaKataloguDAO.java:42)
at cz.aura.isl.katalog.dao.hibernate.HibernateZpravaKataloguDAOTest.testUlozZpravu(HibernateZpravaKataloguDAOTest.java:88)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:392)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:276)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:167)


Here's my mapping file:


<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >

<hibernate-mapping>
<class
name="cz.aura.isl.katalog.davky.domain.ZpravaKatalogu"
table="kzprava"
>
<!-- please tell Joe Hudson that the type 'serial' could not be resolved.. defaulting to java.lang.String -->
<id
name="idZpravy"
type="java.lang.Integer"
column="id_kzprava"
>
<generator class="native"/>
</id>


<property
name="prijataOdeslana"
column="kprijod"
type="java.lang.String"
/>
<property
name="vstupniVystupni"
column="kvsvys"
type="java.lang.String"
/>

<!-- <property
name="casVytvoreniZpravy"
column="kcvytzp"
type="java.lang.String"
not-null="false"
/>
<property
name="kontrolniZpravaZasilkyKatalogu"
column="id_kkonzpz"
type="java.lang.Integer"
/>



<property
name="datumVytvoreniZpravy"
column="kdatode"
type="date"
not-null="false"
/>
<property
name="posledniZpracovanyStitek"
column="kpozpst"
type="java.lang.Integer"
not-null="false"
/>
<property
name="cisloZpravy"
column="kciszp"
type="java.lang.String"
not-null="false"
/>
<property
name="kodMOEExterni"
column="kmoeext"
type="java.lang.String"
not-null="false"
/>

<property
name="prioritaZpravy"
column="kprzpr"
type="java.lang.String"
not-null="false"
/>

<property
name="stavZpravy"
column="kkstspr"
type="java.lang.String"
not-null="false"
/>
-->
</class>
</hibernate-mapping>


and here's my sql table definition:

CREATE TABLE kzprava ( -- kzprava [K_zprava] --
id_kzprava SERIAL

kmoeext CHAR(2)
CHECK (kmoeext matches "[0-9A-Z][0-9A-Z]") CONSTRAINT ckzpravkmoeext____
,
id_kkonzpz INTEGER
,
kkstspr CHAR(1)
CHECK (kkstspr matches "[0-9]") CONSTRAINT ckzpravkkstspr____
,
kciszp CHAR(4)
CHECK (kciszp matches "[0-9][0-9][0-9][0-9]") CONSTRAINT ckzpravkciszp_____

,
kprzpr CHAR(1)
CHECK (kprzpr matches "[PR]") CONSTRAINT ckzpravkprzpr_____

,
kdatode DATE

,
kcvytzp CHAR(4)

,
kpozpst SMALLINT

,
kprijod CHAR(1)
NOT NULL CONSTRAINT nkzpravkprijod____
CHECK (kprijod matches "[PO]") CONSTRAINT ckzpravkprijod____

,
kvsvys CHAR(1)
NOT NULL CONSTRAINT nkzpravkvsvys_____
CHECK (kvsvys matches "[KLO]") CONSTRAINT ckzpravkvsvys_____

)


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 24, 2004 8:16 am 
Senior
Senior

Joined: Fri Nov 21, 2003 5:55 am
Posts: 155
When do you have this exception?
Show your java source code.


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 24, 2004 4:56 pm 
Beginner
Beginner

Joined: Thu Apr 29, 2004 4:03 pm
Posts: 40
solved. it was enough to rewrite from scratch the mapping file. I don't know what was the problem.


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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.